-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update natives and modify description for natives (#937)
* feat: Update natives and modify description for natives * Correct parameter typo and add missing examples header.
- Loading branch information
Showing
9 changed files
with
388 additions
and
70 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
``` | ||
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); | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
``` |
Oops, something went wrong.