diff --git a/GRAPHICS/N_0x32f34ff7f617643b.md b/GRAPHICS/N_0x32f34ff7f617643b.md deleted file mode 100644 index 0cf821e86..000000000 --- a/GRAPHICS/N_0x32f34ff7f617643b.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -ns: GRAPHICS ---- -## _0x32F34FF7F617643B - -```c -// 0x32F34FF7F617643B -void _0x32F34FF7F617643B(Any p0, Any p1); -``` - - -## Parameters -* **p0**: -* **p1**: - diff --git a/GRAPHICS/SetScaleformMovieToUseLargeRt.md b/GRAPHICS/SetScaleformMovieToUseLargeRt.md new file mode 100644 index 000000000..38d09b100 --- /dev/null +++ b/GRAPHICS/SetScaleformMovieToUseLargeRt.md @@ -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. + diff --git a/HUD/GetFilenameForAudioConversation.md b/HUD/GetFilenameForAudioConversation.md new file mode 100644 index 000000000..a4c2828d5 --- /dev/null +++ b/HUD/GetFilenameForAudioConversation.md @@ -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); +``` \ No newline at end of file diff --git a/HUD/GetLabelText.md b/HUD/GetLabelText.md deleted file mode 100644 index 05f997ad7..000000000 --- a/HUD/GetLabelText.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -ns: HUD ---- -## _GET_LABEL_TEXT - -```c -// 0x7B5280EBA9840C72 0x95C4B5AD -char* _GET_LABEL_TEXT(char* labelName); -``` - -``` -Gets a string literal from a label name. -GET_F* -``` - -## Parameters -* **labelName**: - -## Return value diff --git a/TASK/TaskWarpPedIntoVehicle.md b/TASK/TaskWarpPedIntoVehicle.md index 7b02cf0c1..3df38cfb7 100644 --- a/TASK/TaskWarpPedIntoVehicle.md +++ b/TASK/TaskWarpPedIntoVehicle.md @@ -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); +``` \ No newline at end of file