Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update natives and modify description for natives #937

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions GRAPHICS/N_0x32f34ff7f617643b.md

This file was deleted.

20 changes: 20 additions & 0 deletions GRAPHICS/SetScaleformMovieToUseLargeRt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
ns: GRAPHICS
aliases: ["0x32F34FF7F617643B"]
---
## SET_SCALEFORM_MOVIE_TO_USE_LARGE_RT

```c
// 0x32F34FF7F617643B
void SET_SCALEFORM_MOVIE_TO_USE_LARGE_RT(int scaleformMovieId, cs_type(Any) BOOL useLargeRT);
```

```
NativeDB Introduced: v573
```

Configures a Scaleform movie to render to a large render target (1280x720), which is useful for ensuring higher quality and clarity in certain display scenarios. Such as displaying the name of an organization (CEO Office) in a visually impactful way for example.

## Parameters
* **scaleformMovieId**: The handle of the Scaleform to be used.
* **useLargeRT**: A boolean switch to enable/disable the use of the large rendertarget.
73 changes: 73 additions & 0 deletions HUD/GetFilenameForAudioConversation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
ns: HUD
aliases: ["0x7B5280EBA9840C72", _GET_LABEL_TEXT"]
---
## GET_FILENAME_FOR_AUDIO_CONVERSATION

```c
// 0x7B5280EBA9840C72 0x95C4B5AD
char* GET_FILENAME_FOR_AUDIO_CONVERSATION(char* labelName);
spacevx marked this conversation as resolved.
Show resolved Hide resolved
```

Gets a localized string literal from a label name. This is used to get the filename of the audio conversation associated with the provided label name.

## Parameters
* **labelName**: The label name for which the audio conversation filename is requested.

## Return value
Returns the filename associated with the provided labelName.

## Examples

```lua
-- Get the vehicle in which the player is currently seated
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)

-- Get the model of the vehicle
local model = GetEntityModel(vehicle)

-- Get the display name of the vehicle model
local displayName = GetDisplayNameFromVehicleModel(model)

-- Get the label text for the audio conversation associated with the display name
local label = GetFilenameForAudioConversation(displayName)

-- Print the label text
print(label)
```

```js
// Get the vehicle in which the player is currently seated
const vehicle = GetVehiclePedIsIn(PlayerPedId(), false);

// Get the model of the vehicle
const model = GetEntityModel(vehicle);

// Get the display name of the vehicle model
const displayName = GetDisplayNameFromVehicleModel(model);

// Get the label text for the audio conversation associated with the display name
const label = GetFilenameForAudioConversation(displayName);

// Log the label text to the console
console.log(label);
```

```cs
using static CitizenFX.Core.Native.API;

// Get the vehicle in which the player is currently seated
Vehicle vehicle = GetVehiclePedIsIn(PlayerPedId(), false);

// Get the model of the vehicle
uint model = (uint)GetEntityModel(vehicle);

// Get the display name of the vehicle model
string displayName = GetDisplayNameFromVehicleModel(model);

// Get the label text for the audio conversation associated with the display name
string label = GetFilenameForAudioConversation(displayName);

// Print the label text
Debug.WriteLine(label);
```
19 changes: 0 additions & 19 deletions HUD/GetLabelText.md

This file was deleted.

123 changes: 121 additions & 2 deletions TASK/TaskWarpPedIntoVehicle.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,127 @@ ns: TASK
void TASK_WARP_PED_INTO_VEHICLE(Ped ped, Vehicle vehicle, int seatIndex);
```

```
NativeDB Introduced: v323
```

Warp a ped into a vehicle.

**Note**: It's better to use [`TASK_ENTER_VEHICLE`](#_0xC20E50AA46D09CA8) with the flag "warp" flag instead of this native.

## Parameters
* **ped**:
* **vehicle**:
* **ped**: The Ped to be warped into the vehicle.
* **vehicle**: The target vehicle into which the ped will be warped.
* **seatIndex**: See eSeatPosition declared in [`IS_VEHICLE_SEAT_FREE`](#_0x22AC59A870E6A669).


## Examples

```lua
-- This example creates a vehicle and warps the player into the driver's seat

-- Retrieve the player ped
local playerPed = PlayerPedId()

-- Define the vehicle model and check if it exists in the game files
local modelHash = `adder` -- Use Compile-time hashes to get the model hash
if not IsModelInCdimage(modelHash) then
return
end

-- Request the model and wait for it to load
RequestModel(modelHash)
repeat
Wait(0)
until HasModelLoaded(modelHash)

-- Create the vehicle at the player's coordinates with a heading of 0.0
local coordsPlayer, heading = GetEntityCoords(playerPed), 0.0
local vehicle = CreateVehicle(modelHash, coordsPlayer, heading, true, false)

-- Define the seat index for the Ped (e.g., -1 for the driver's seat)
local seatIndex = -1

-- Check if the vehicle exists and the player is alive
if not DoesEntityExist(vehicle) or IsEntityDead(playerPed) then
return
end

-- Warp the Ped into the specified vehicle seat
TaskWarpPedIntoVehicle(playerPed, vehicle, seatIndex)
```

```js
// This example creates a vehicle and warps the player into the driver's seat

// Retrieve the player ped
const playerPed = PlayerPedId();

// Define the vehicle model and check if it exists in the game files
const modelHash = GetHashKey("adder");
if (!IsModelInCdimage(modelHash)) {
return;
}

// Request the model and wait for it to load
RequestModel(modelHash);
while (!HasModelLoaded(modelHash)) {
Wait(0);
}

// Create the vehicle at the player's coordinates with a heading of 0.0
const coordsPlayer = GetEntityCoords(playerPed);
const heading = 0.0;
const vehicle = CreateVehicle(modelHash, coordsPlayer, heading, true, false);

// Define the seat index for the Ped (e.g., -1 for the driver's seat)
const seatIndex = -1;

// Check if the vehicle exists and the player is alive
if (!DoesEntityExist(vehicle) || IsEntityDead(playerPed)) {
return;
}

// Warp the Ped into the specified vehicle seat
TaskWarpPedIntoVehicle(playerPed, vehicle, seatIndex);
```

```cs
// This example creates a vehicle and warps the player into the driver's seat
using static CitizenFX.Core.Native.API;

// Retrieve the player ped
Ped playerPed = PlayerPedId();

// Define the vehicle model and check if it exists in the game files
uint modelHash = (uint)GetHashKey("adder");

if (!IsModelInCdimage(modelHash))
{
return;
}

// Request the model and wait for it to load
RequestModel(modelHash);
while (!HasModelLoaded(modelHash))
{
Delay(0);
}

// Create the vehicle at the player's coordinates with a heading of 0.0
Vector3 coordsPlayer = GetEntityCoords(playerPed);
float heading = 0.0f;
Vehicle vehicle = CreateVehicle(modelHash, coordsPlayer, heading, true, false);

// Define the seat index for the Ped (e.g., -1 for the driver's seat)
int seatIndex = -1;

// Check if the vehicle exists and the player is alive
if (!DoesEntityExist(vehicle) || IsEntityDead(playerPed))
{
return;
}

// Warp the Ped into the specified vehicle seat
TaskWarpPedIntoVehicle(playerPed, vehicle, seatIndex);
```
85 changes: 85 additions & 0 deletions VEHICLE/SetTransformRateForAnimation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
ns: VEHICLE
aliases: ["0x498218259FB7C72D", "_SET_UNK_FLOAT_0x104_FOR_SUBMARINE_VEHICLE_TASK"]
---
## SET_TRANSFORM_RATE_FOR_ANIMATION

```c
// 0x498218259FB7C72D
void SET_TRANSFORM_RATE_FOR_ANIMATION(Vehicle vehicle, float transformRate);
```

Affects the playback speed of the submarine car conversion animations. Does not affect hardcoded animations such as the wheels being retracted. In decompiled scripts the only value used for transformRate is 2.5.

## Parameters
* **vehicle**: The vehicle for which the submarine car conversion animation speed should be adjusted.
* **transformRate**: The rate at which the submarine car conversion animations will be played.

## Examples
```lua
-- This example sets the transform rate for the submarine car conversion animations to 2.5

-- Retrieve the player ped
local playerPed = PlayerPedId()

-- Retrieve the vehicle in which the player is currently seated
local vehicle = GetVehiclePedIsIn(playerPed, false) -- Get the vehicle in which the player is currently seated

-- Retrieve the vehicle model hash
local vehicleHash = GetEntityModel(vehicle)

-- Check if the vehicle exists in the game world and if it is a Stromberg.
if not DoesEntityExist(vehicle) or not vehicleHash == GetHashKey("stromberg") then
-- If the vehicle does not exist or it's not a stromberg, end the execution of the code here.
return
end

-- Set the transform rate for the submarine car conversion animations to 2.5
SetTransformRateForAnimation(vehicle, 2.5)
```

```js
// This example sets the transform rate for the submarine car conversion animations to 2.5

// Retrieve the player ped
const playerPed = PlayerPedId();

// Retrieve the vehicle in which the player is currently seated
const vehicle = GetVehiclePedIsIn(playerPed, false); // Get the vehicle in which the player is currently seated

// Retrieve the vehicle model hash
const vehicleHash = GetEntityModel(vehicle);

// Check if the vehicle exists in the game world and if it is a Stromberg.
if (!DoesEntityExist(vehicle) || vehicleHash !== GetHashKey("stromberg")) {
// If the vehicle does not exist or it's not a stromberg, end the execution of the code here.
return;
}

// Set the transform rate for the submarine car conversion animations to 2.5
SetTransformRateForAnimation(vehicle, 2.5);
```

```cs
// This example sets the transform rate for the submarine car conversion animations to 2.5
using static CitizenFX.Core.Native.API;

// Retrieve the player ped
Ped playerPed = PlayerPedId();

// Retrieve the vehicle in which the player is currently seated
Vehicle vehicle = GetVehiclePedIsIn(playerPed, false); // Get the vehicle in which the player is currently seated

// Retrieve the vehicle model hash
uint vehicleHash = (uint)GetEntityModel(vehicle);

// Check if the vehicle exists in the game world and if it is a Stromberg.
if (!DoesEntityExist(vehicle) || vehicleHash != (uint)GetHashKey("stromberg"))
{
// If the vehicle does not exist or it's not a stromberg, end the execution of the code here.
return;
}

// Set the transform rate for the submarine car conversion animations to 2.5
SetTransformRateForAnimation(vehicle, 2.5f);
```
Loading
Loading