Skip to content

Commit

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

This file was deleted.

16 changes: 16 additions & 0 deletions GRAPHICS/SetScaleformMovieToUseLargeRt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
ns: GRAPHICS
---
## 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.
75 changes: 75 additions & 0 deletions HUD/GetFilenameForAudioConversation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
ns: HUD
aliases: ["_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**:
## Return value
## 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)
```

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

```csharp
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)
```

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

```csharp
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);
```

0 comments on commit a5ae587

Please sign in to comment.