From 98dfb13ddc14ff0741b636c7905ffc681a317ae1 Mon Sep 17 00:00:00 2001 From: Space V <40030799+ahcenezdh@users.noreply.github.com> Date: Thu, 21 Dec 2023 23:40:07 +0100 Subject: [PATCH 1/2] feat(natives/vehicle): update vehicle natives --- VEHICLE/GetIsBoatCapsized.md | 122 ++++++++++++++++++++++++++++++++ VEHICLE/N_0x0a3f820a9a9a9ac5.md | 19 ----- VEHICLE/N_0xba91d045575699ad.md | 15 ---- VEHICLE/SetHeliCombatOffset.md | 22 ++++++ 4 files changed, 144 insertions(+), 34 deletions(-) create mode 100644 VEHICLE/GetIsBoatCapsized.md delete mode 100644 VEHICLE/N_0x0a3f820a9a9a9ac5.md delete mode 100644 VEHICLE/N_0xba91d045575699ad.md create mode 100644 VEHICLE/SetHeliCombatOffset.md diff --git a/VEHICLE/GetIsBoatCapsized.md b/VEHICLE/GetIsBoatCapsized.md new file mode 100644 index 000000000..0d9e7a538 --- /dev/null +++ b/VEHICLE/GetIsBoatCapsized.md @@ -0,0 +1,122 @@ +--- +ns: VEHICLE +aliases: ["0xBA91D045575699AD"] +--- +## GET_IS_BOAT_CAPSIZED + +```c +// 0xBA91D045575699AD +BOOL GET_IS_BOAT_CAPSIZED(Vehicle vehicle); +``` + +Checks whether the specified boat vehicle is capsized, meaning it has overturned or is upside down in the water. + +## Parameters +* **vehicle**: The vehicle to check. This should be a boat-type vehicle. + +## Return value +Returns `true` if the specified boat is capsized, `false` otherwise. + +## Examples + +```lua +-- This example checks if the player is in a boat and if the boat is capsized. + +-- Retrieve the LocalPlayer. +local playerPed = PlayerPedId() + +-- Retrieve the vehicle the player is in +local vehicle = GetVehiclePedIsIn(playerPed, false) + +-- Retrieve the model of the vehicle +local vehicleModel = GetEntityModel(vehicle) + +-- 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 + +-- Check if the vehicle is a boat. +if not IsThisModelABoat(vehicleModel) then + -- If the vehicle is not a boat, end the execution of the code here. + return +end + +-- Check if the boat is capsized. +if GetIsBoatCapsized(vehicle) then + print("The boat is capsized!") +else + print("The boat is not capsized!") +end +``` + +```js +// This example checks if the player is in a boat and if the boat is capsized. + +// Retrieve the LocalPlayer. +const playerPed = PlayerPedId(); + +// Retrieve the vehicle the player is in +const vehicle = GetVehiclePedIsIn(playerPed, false); + +// Retrieve the model of the vehicle +const vehicleModel = GetEntityModel(vehicle); + +// 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; +} + +// Check if the vehicle is a boat. +if (!IsThisModelABoat(vehicleModel)) { + // If the vehicle is not a boat, end the execution of the code here. + return; +} + +// Check if the boat is capsized +if (GetIsBoatCapsized(vehicle)) { + console.log("The boat is capsized!"); +} else { + console.log("The boat is not capsized!"); +} +``` + +```cs +// This example checks if the player is in a boat and if the boat is capsized. +using static CitizenFX.Core.Native.API; + +// Retrieve the LocalPlayer. +Ped playerPed = PlayerPedId(); + +// Retrieve the vehicle the player is in +Vehicle vehicle = GetVehiclePedIsIn(playerPed, false); + +// Retrieve the model of the vehicle +uint vehicleModel = (uint)GetEntityModel(vehicle); + +// 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; +} + +// Check if the vehicle is a boat. +if (!IsThisModelABoat(vehicleModel)) +{ + // If the vehicle is not a boat, end the execution of the code here. + return; +} + +// Check if the boat is capsized +if (GetIsBoatCapsized(vehicle)) +{ + Debug.WriteLine("The boat is capsized!"); +} +else +{ + Debug.WriteLine("The boat is not capsized!"); +} +``` diff --git a/VEHICLE/N_0x0a3f820a9a9a9ac5.md b/VEHICLE/N_0x0a3f820a9a9a9ac5.md deleted file mode 100644 index 50e884726..000000000 --- a/VEHICLE/N_0x0a3f820a9a9a9ac5.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -ns: VEHICLE ---- -## _0x0A3F820A9A9A9AC5 - -```c -// 0x0A3F820A9A9A9AC5 -void _0x0A3F820A9A9A9AC5(Vehicle vehicle, float x, float y, float z); -``` - -``` -NativeDB Introduced: v1180 -``` - -## Parameters -* **vehicle**: -* **x**: -* **y**: -* **z**: diff --git a/VEHICLE/N_0xba91d045575699ad.md b/VEHICLE/N_0xba91d045575699ad.md deleted file mode 100644 index fb2a38150..000000000 --- a/VEHICLE/N_0xba91d045575699ad.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -ns: VEHICLE ---- -## _0xBA91D045575699AD - -```c -// 0xBA91D045575699AD -BOOL _0xBA91D045575699AD(Vehicle vehicle); -``` - - -## Parameters -* **vehicle**: - -## Return value diff --git a/VEHICLE/SetHeliCombatOffset.md b/VEHICLE/SetHeliCombatOffset.md new file mode 100644 index 000000000..cab595117 --- /dev/null +++ b/VEHICLE/SetHeliCombatOffset.md @@ -0,0 +1,22 @@ +--- +ns: VEHICLE +aliases: ["0x0A3F820A9A9A9AC5"] +--- +## SET_HELI_COMBAT_OFFSET + +```c +// 0x0A3F820A9A9A9AC5 +void SET_HELI_COMBAT_OFFSET(Vehicle vehicle, float x, float y, float z); +``` + +Set a specific offset for helis chasing target in combat + +``` +NativeDB Introduced: v1180 +``` + +## Parameters +* **vehicle**: Helicopter for which the combat offset is being set. +* **x**: Offset along the X-axis (left/right) relative to the helicopter's current position and orientation +* **y**: Offset along the Y-axis (forward/backward) relative to the helicopter's current position and orientation +* **z**: Offset along the Z-axis (up/down) relative to the helicopter's current position and orientation. From 9db80c95672ea9a42a0a6bf2d1e282faf036442b Mon Sep 17 00:00:00 2001 From: ammonia-cfx <38232208+4mmonium@users.noreply.github.com> Date: Fri, 22 Dec 2023 03:50:52 +0300 Subject: [PATCH 2/2] Update GetIsBoatCapsized.md Generally, there's no spaces between `## Examples` and the code blocks. --- VEHICLE/GetIsBoatCapsized.md | 1 - 1 file changed, 1 deletion(-) diff --git a/VEHICLE/GetIsBoatCapsized.md b/VEHICLE/GetIsBoatCapsized.md index 0d9e7a538..aecfe5400 100644 --- a/VEHICLE/GetIsBoatCapsized.md +++ b/VEHICLE/GetIsBoatCapsized.md @@ -18,7 +18,6 @@ Checks whether the specified boat vehicle is capsized, meaning it has overturned Returns `true` if the specified boat is capsized, `false` otherwise. ## Examples - ```lua -- This example checks if the player is in a boat and if the boat is capsized.