Skip to content

Commit

Permalink
feat: Update natives and modify description for natives
Browse files Browse the repository at this point in the history
  • Loading branch information
spacevx committed Nov 27, 2023
1 parent 99a7a82 commit bd6a61c
Show file tree
Hide file tree
Showing 9 changed files with 249 additions and 70 deletions.
15 changes: 0 additions & 15 deletions GRAPHICS/N_0x32f34ff7f617643b.md

This file was deleted.

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

```c
// 0x32F34FF7F617643B
void SET_SCALEFORM_MOVIE_TO_USE_LARGE_RT(cs_type(Any) int scaleformHandle, cs_type(Any) bool toggle);
```
### Used to configure a Scaleform to use a large rendertarget. This can be useful for centering text for example, when displaying the name of an organization. (DLC Import/Export)
## Parameters
* **scaleformHandle**: The handle of the Scaleform to be used.
* **toggle**: A boolean switch to enable/disable the use of the large rendertarget.
76 changes: 76 additions & 0 deletions HUD/GetFilenameForAudioConversation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
ns: HUD
aliases: ["0x7B5280EBA9840C72", _GET_LABEL_TEXT"]
---
## GET_FILENAME_FOR_AUDIO_CONVERSATION

```c
// 0x7B5280EBA9840C72 0x95C4B5AD
char* GET_FILENAME_FOR_AUDIO_CONVERSATION(char* labelName);
```
```
Gets a localized string literal from a label name.
GET_F*
```
## 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.

80 changes: 78 additions & 2 deletions TASK/TaskWarpPedIntoVehicle.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,83 @@ void TASK_WARP_PED_INTO_VEHICLE(Ped ped, Vehicle vehicle, int seatIndex);
```
## Parameters
* **ped**:
* **vehicle**:
* **ped**: The Ped (player character) to be warped into the vehicle.
* **vehicle**: The target vehicle into which the pedestrian will be warped.
* **seatIndex**: See eSeatPosition declared in [`IS_VEHICLE_SEAT_FREE`](#_0x22AC59A870E6A669).
## Examples
```lua
-- Get the player's ped ID
local playerPed = PlayerPedId()
-- Check if the model exist in the game for the client
local modelHash = `adder` -- Use Compile-time hashes to get the hash of this model
if not IsModelInCdimage(modelHash) then
return
end
RequestModel(modelHash) -- Request the model
repeat
Wait(0) -- Wait until the model is loaded
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)
local seatIndex = -1 -- -1 for driver seat
if not DoesEntityExist(vehicle) or IsEntityDead(playerPed) then return end -- Check if the vehicle exist and if the player is not dead
-- Warp the ped into the specified vehicle at the designated seat
TaskWarpPedIntoVehicle(playerPed, vehicle, seatIndex)
```

```js
// Get the player's ped ID
const playerPed = PlayerPedId();

// Check if the model exist in the game for the client
const modelHash = GetHashKey('adder'); // Use Compile-time hashes to get the hash of this model
if (!IsModelInCdimage(modelHash)) return;

RequestModel(modelHash); // Request the model
while (!HasModelLoaded(modelHash)) Wait(0); // Wait until the model is loaded

// 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);

const seatIndex = -1; // -1 for driver seat

if (!DoesEntityExist(vehicle) || IsEntityDead(playerPed)) return; // Check if the vehicle exist and if the player is not dead
// Warp the ped into the specified vehicle at the designated seat
TaskWarpPedIntoVehicle(playerPed, vehicle, seatIndex);
```

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

// Get the player's ped ID
Ped playerPed = PlayerPedId();

// Check if the model exist in the game for the client
uint modelHash = (uint)GetHashKey("adder");
if (!IsModelInCdimage(modelHash)) return;

RequestModel(modelHash); // Request the model
while (!HasModelLoaded(modelHash)) Delay(0); // Wait until the model is loaded
// 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);

int seatIndex = -1; // -1 for driver seat
if (!DoesEntityExist(vehicle) || IsEntityDead(playerPed)) return; // Check if the vehicle exist and if the player is not dead
// Warp the ped into the specified vehicle at the designated seat
TaskWarpPedIntoVehicle(playerPed, vehicle, seatIndex);
```
41 changes: 41 additions & 0 deletions VEHICLE/SetTransformRateForAnimation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
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
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) -- Get the vehicle in which the player is currently seated
if GetEntityModel(vehicle) ~= joaat("stromberg") then return end -- Check if the vehicle is a Stromberg
-- Set the transform rate for the submarine car conversion animations to 2.5
SetTransformRateForAnimation(vehicle, 2.5)
```

```js
const vehicle = GetVehiclePedIsIn(PlayerPedId(), false); // Get the vehicle in which the player is currently seated
if (GetEntityModel(vehicle) !== GetHashKey("stromberg")) return; // Check if the vehicle is a Stromberg
// Set the transform rate for the submarine car conversion animations to 2.5
SetTransformRateForAnimation(vehicle, 2.5);
```

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

Vehicle vehicle = GetVehiclePedIsIn(PlayerPedId(), false); // Get the vehicle in which the player is currently seated
if (GetEntityModel(vehicle) != (uint)GetHashKey("stromberg")) return; // Check if the vehicle is a Stromberg
// Set the transform rate for the submarine car conversion animations to 2.5
SetTransformRateForAnimation(vehicle, 2.5);
```
37 changes: 37 additions & 0 deletions VEHICLE/SetTransformToSubmarineUsesAlternateInput.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
ns: VEHICLE
aliases: ["0x41B9FB92EDED32A6", "_SET_UNK_BOOL_0x102_FOR_SUBMARINE_VEHICLE_TASK"]
---
## SET_TRANSFORM_TO_SUBMARINE_USES_ALTERNATE_INPUT

```c
// 0x41B9FB92EDED32A6
void SET_TRANSFORM_TO_SUBMARINE_USES_ALTERNATE_INPUT(Vehicle vehicle, bool toogle);
```
### This native changes the key used to transform a vehicle into submarine mode. When set to true, the transformation key switches from the default raise/lower convertible roof key (usually 'H') to the special vehicle transformation key (usually 'X').
## Parameters
* **vehicle**: The vehicle for which the submarine mode should be configured.
* **toogle**: A boolean switch to enable/disable the use of alternate input.
```lua
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) -- Get the vehicle in which the player is currently seated
-- Set the key for submarine mode transformation to special vehicle transform (X by default)
SetTransformToSubmarineUsesAlternateInput(vehicle, true)
```

```js
const vehicle = GetVehiclePedIsIn(PlayerPedId(), false); // Get the vehicle in which the player is currently seated
// Set the key for submarine mode transformation to special vehicle transform (X by default)
SetTransformToSubmarineUsesAlternateInput(vehicle, true);
```

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

Vehicle vehicle = GetVehiclePedIsIn(PlayerPedId(), false); // Get the vehicle in which the player is currently seated
// Set the key for submarine mode transformation to special vehicle transform (X by default)
SetTransformToSubmarineUsesAlternateInput(vehicle, true);
```

17 changes: 0 additions & 17 deletions VEHICLE/SetUnkBool_0x102ForSubmarineVehicleTask.md

This file was deleted.

17 changes: 0 additions & 17 deletions VEHICLE/SetUnkFloat_0x104ForSubmarineVehicleTask.md

This file was deleted.

0 comments on commit bd6a61c

Please sign in to comment.