From d0fc9315cc08f79f68453894570fe5bc1410465c Mon Sep 17 00:00:00 2001 From: Space V <40030799+ahcenezdh@users.noreply.github.com> Date: Thu, 21 Dec 2023 23:49:10 +0100 Subject: [PATCH 1/3] feat(natives/vehicle): update vehicle natives --- VEHICLE/N_0x0bbb9a7a8ffe931b.md | 18 ----- VEHICLE/N_0x1b212b26dd3c04df.md | 20 ----- VEHICLE/SetOpenRearDoorsOnExplosion.md | 108 +++++++++++++++++++++++++ VEHICLE/SetPlaneSectionDamageScale.md | 44 ++++++++++ 4 files changed, 152 insertions(+), 38 deletions(-) delete mode 100644 VEHICLE/N_0x0bbb9a7a8ffe931b.md delete mode 100644 VEHICLE/N_0x1b212b26dd3c04df.md create mode 100644 VEHICLE/SetOpenRearDoorsOnExplosion.md create mode 100644 VEHICLE/SetPlaneSectionDamageScale.md diff --git a/VEHICLE/N_0x0bbb9a7a8ffe931b.md b/VEHICLE/N_0x0bbb9a7a8ffe931b.md deleted file mode 100644 index 8f3d5d50b..000000000 --- a/VEHICLE/N_0x0bbb9a7a8ffe931b.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -ns: VEHICLE ---- -## _0x0BBB9A7A8FFE931B - -```c -// 0x0BBB9A7A8FFE931B -void _0x0BBB9A7A8FFE931B(Any p0, Any p1, Any p2); -``` - -``` -NativeDB Introduced: v1290 -``` - -## Parameters -* **p0**: -* **p1**: -* **p2**: diff --git a/VEHICLE/N_0x1b212b26dd3c04df.md b/VEHICLE/N_0x1b212b26dd3c04df.md deleted file mode 100644 index 05f8506cb..000000000 --- a/VEHICLE/N_0x1b212b26dd3c04df.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -ns: VEHICLE ---- -## _0x1B212B26DD3C04DF - -```c -// 0x1B212B26DD3C04DF -void _0x1B212B26DD3C04DF(Vehicle vehicle, BOOL toggle); -``` - -``` -Sets a value that appears to affect door opening behavior when damaged. - -SET_* -``` - -## Parameters -* **vehicle**: -* **toggle**: - diff --git a/VEHICLE/SetOpenRearDoorsOnExplosion.md b/VEHICLE/SetOpenRearDoorsOnExplosion.md new file mode 100644 index 000000000..bc1d53c6f --- /dev/null +++ b/VEHICLE/SetOpenRearDoorsOnExplosion.md @@ -0,0 +1,108 @@ +--- +ns: VEHICLE +aliases: ["0x1B212B26DD3C04DF"] +--- +## SET_OPEN_REAR_DOORS_ON_EXPLOSION + +```c +// 0x1B212B26DD3C04DF +void SET_OPEN_REAR_DOORS_ON_EXPLOSION(Vehicle vehicle, BOOL toggle); +``` + +Enables or disables the opening of a vehicle's rear doors in the event of a sticky bomb explosion. This native is effective for armored vehicles, such as the Stockade (Brinks vehicle), allowing the rear doors to be opened through controlled explosions, which might otherwise remain locked due to the vehicle nature. + + +## Parameters +* **vehicle**: The vehicle to apply this setting to. +* **toggle**: A boolean value where `true` allows the rear doors to open upon explosion, and `false` prevents them from opening. + +## Return value + +This native does not return any value. + +## Examples +```lua +-- This example disables the rear doors of the vehicle from opening upon explosion. + +-- Retrieve the LocalPlayer. +local playerPed = PlayerPedId() + +-- Retrieve the vehicle the player is currently in. +local vehicle = GetVehiclePedIsIn(playerPed, false) + +-- Check if the vehicle exists in the game world. +if not DoesEntityExist(vehicle) then + -- If the vehicle does not exist, end the execution of the code here. + return +end + +-- Retrieve the model of the vehicle +local modelVehicle = GetEntityModel(vehicle) + +-- Retrieve the hash of the Stockade. +local hashStockade = GetHashKey("stockade") + +-- Check if the vehicle is a Stockade. +if (modelVehicle == hashStockade) then + -- Disable the rear doors from opening upon explosion. + SetOpenRearDoorsOnExplosion(vehicle, true) +end +``` + +```js +// This example disables the rear doors of the vehicle from opening upon explosion. + +// Retrieve the LocalPlayer. +const playerPed = PlayerPedId(); + +// Retrieve the vehicle the player is currently in. +const vehicle = GetVehiclePedIsIn(playerPed, false); + +// Check if the vehicle exists in the game world. +if (!DoesEntityExist(vehicle)) { + // If the vehicle does not exist, end the execution of the code here. + return; +} + +// Retrieve the model of the vehicle. +const modelVehicle = GetEntityModel(vehicle); + +// Retrieve the hash of the Stockade. +const hashStockade = GetHashKey("stockade"); + +// Check if the vehicle is a Stockade. +if (modelVehicle === hashStockade) { + // Disable the rear doors from opening upon explosion. + SetOpenRearDoorsOnExplosion(vehicle, true); +} +``` + +```cs +using static CitizenFX.Core.Native.API; +// This example disables the rear doors of the vehicle from opening upon explosion. + +// Retrieve the LocalPlayer. +Ped playerPed = PlayerPedId(); + +// Retrieve the vehicle the player is currently in. +Vehicle vehicle = GetVehiclePedIsIn(playerPed, false); + +// Check if the vehicle exists in the game world. +if (!DoesEntityExist(vehicle)) +{ + // If the vehicle does not exist, end the execution of the code here. + return; +} + +// Retrieve the model of the vehicle. +uint modelVehicle = (uint)GetEntityModel(vehicle); + +// Retrieve the hash of the Stockade. +uint hashStockade = (uint)GetHashKey("stockade"); + +// Check if the vehicle is a Stockade. +if (modelVehicle == hashStockade) { + // Disable the rear doors from opening upon explosion. + SetOpenRearDoorsOnExplosion(vehicle, true); +} +``` \ No newline at end of file diff --git a/VEHICLE/SetPlaneSectionDamageScale.md b/VEHICLE/SetPlaneSectionDamageScale.md new file mode 100644 index 000000000..822a9a10c --- /dev/null +++ b/VEHICLE/SetPlaneSectionDamageScale.md @@ -0,0 +1,44 @@ +--- +ns: VEHICLE +aliases: ["0x0BBB9A7A8FFE931B"] +--- +## SET_PLANE_SECTION_DAMAGE_SCALE + +```c +// 0x0BBB9A7A8FFE931B +void SET_PLANE_SECTION_DAMAGE_SCALE(Vehicle vehicle, int damageSection, cs_type(Any) float damageScale); +``` + +Adjusts the scale of damage applied to a specified section of a plane. +In the decompiled scripts the `damageScale` is always set to `0f` (maybe to disable damages on the specified section) + +```c +enum PLANE_DAMAGE_SECTION { + WING_L = 0, + WING_R = 1, + TAIL = 2, + ENGINE_L = 3, + ENGINE_R = 4, + ELEVATOR_L = 5, + ELEVATOR_R = 6, + AILERON_L = 7, + AILERON_R = 8, + RUDDER = 9, + RUDDER_2 = 10, + AIRBRAKE_L = 11, + AIRBRAKE_R = 12 +} +``` + +``` +NativeDB Introduced: v1290 +``` + +## Parameters +* **vehicle**: Plane to which the damage scale adjustment will be applied. +* **damageSection**: Specific section of the plane, as defined in the `PLANE_DAMAGE_SECTION` enum, where the damage scale will be adjusted. +* **damageScale**: A float value representing the scale of damage to be applied to the specified section. + +## Return value + +This native does not return any value. \ No newline at end of file From 1d38af1153302579fedf4103308a4f9794b1c003 Mon Sep 17 00:00:00 2001 From: ammonia-cfx <38232208+4mmonium@users.noreply.github.com> Date: Tue, 26 Dec 2023 04:23:43 +0300 Subject: [PATCH 2/3] Update SetPlaneSectionDamageScale.md Correct enum name, not like there's anything wrong with the original name provided, but camel-casing seems more common for enums within native docs. --- VEHICLE/SetPlaneSectionDamageScale.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/VEHICLE/SetPlaneSectionDamageScale.md b/VEHICLE/SetPlaneSectionDamageScale.md index 822a9a10c..5fc2081bf 100644 --- a/VEHICLE/SetPlaneSectionDamageScale.md +++ b/VEHICLE/SetPlaneSectionDamageScale.md @@ -13,7 +13,7 @@ Adjusts the scale of damage applied to a specified section of a plane. In the decompiled scripts the `damageScale` is always set to `0f` (maybe to disable damages on the specified section) ```c -enum PLANE_DAMAGE_SECTION { +enum ePlaneDamageSection { WING_L = 0, WING_R = 1, TAIL = 2, @@ -36,9 +36,8 @@ NativeDB Introduced: v1290 ## Parameters * **vehicle**: Plane to which the damage scale adjustment will be applied. -* **damageSection**: Specific section of the plane, as defined in the `PLANE_DAMAGE_SECTION` enum, where the damage scale will be adjusted. +* **damageSection**: Specific section of the plane, as defined in the `ePlaneDamageSection` enum, where the damage scale will be adjusted. * **damageScale**: A float value representing the scale of damage to be applied to the specified section. ## Return value - -This native does not return any value. \ No newline at end of file +This native does not return any value. From aa1de3768b9fa81665bfc8a64db9cd25d3cca2ca Mon Sep 17 00:00:00 2001 From: ammonia-cfx <38232208+4mmonium@users.noreply.github.com> Date: Tue, 26 Dec 2023 04:25:54 +0300 Subject: [PATCH 3/3] Update SetOpenRearDoorsOnExplosion.md Remove newline under ## Return value, also add newline to end of file. --- VEHICLE/SetOpenRearDoorsOnExplosion.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/VEHICLE/SetOpenRearDoorsOnExplosion.md b/VEHICLE/SetOpenRearDoorsOnExplosion.md index bc1d53c6f..4fd532f2f 100644 --- a/VEHICLE/SetOpenRearDoorsOnExplosion.md +++ b/VEHICLE/SetOpenRearDoorsOnExplosion.md @@ -17,7 +17,6 @@ Enables or disables the opening of a vehicle's rear doors in the event of a stic * **toggle**: A boolean value where `true` allows the rear doors to open upon explosion, and `false` prevents them from opening. ## Return value - This native does not return any value. ## Examples @@ -105,4 +104,4 @@ if (modelVehicle == hashStockade) { // Disable the rear doors from opening upon explosion. SetOpenRearDoorsOnExplosion(vehicle, true); } -``` \ No newline at end of file +```