diff --git a/PED/GetVehiclePedIsIn.md b/PED/GetVehiclePedIsIn.md index 36e3aeb81..a26af6dc4 100644 --- a/PED/GetVehiclePedIsIn.md +++ b/PED/GetVehiclePedIsIn.md @@ -8,12 +8,70 @@ ns: PED Vehicle GET_VEHICLE_PED_IS_IN(Ped ped, BOOL lastVehicle); ``` -Gets the vehicle the specified Ped is in. Returns 0 if the ped is/was not in a vehicle. -If the Ped is not in a vehicle and includeLastVehicle is true, the vehicle they were last in is returned. +Retrieves the vehicle the specified ped is currently in, or the last vehicle they were in. ## Parameters * **ped**: The target ped -* **lastVehicle**: False = CurrentVehicle, True = LastVehicle +* **lastVehicle**: A boolean value where `false` represents the current vehicle the Ped is in, and `true` represents the last vehicle the Ped was in. ## Return value The vehicle id. Returns 0 if the ped is/was not in a vehicle. + +## Examples +```lua +-- This example gets the vehicle the player is currently in and print the vehicle id. + +-- 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 + +-- Print the vehicle id +print("Vehicle ID: " .. vehicle) +``` + +```js +// This example gets the vehicle the player is currently in and print the vehicle id. + +// Retrieve the player ped. +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; +} + +// Print the vehicle id +console.log(`Vehicle ID: ${vehicle}`); +``` + +```cs +// This example gets the vehicle the player is currently in and print the vehicle id. +using static CitizenFX.Core.Native.API; + +// Retrieve the player ped +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; +} + +// Print the vehicle id +Debug.WriteLine($"Vehicle ID: {vehicle}"); +``` diff --git a/VEHICLE/AllowAmbientVehiclesToAvoidAdverseConditions.md b/VEHICLE/AllowAmbientVehiclesToAvoidAdverseConditions.md new file mode 100644 index 000000000..7b8b60022 --- /dev/null +++ b/VEHICLE/AllowAmbientVehiclesToAvoidAdverseConditions.md @@ -0,0 +1,16 @@ +--- +ns: VEHICLE +aliases: ["0xB264C4D2F2B0A78B"] +--- +## ALLOW_AMBIENT_VEHICLES_TO_AVOID_ADVERSE_CONDITIONS + +```c +// 0xB264C4D2F2B0A78B 0x45F72495 +void ALLOW_AMBIENT_VEHICLES_TO_AVOID_ADVERSE_CONDITIONS(Vehicle vehicle); +``` + +This native it's a debug native. Won't do anything. + +## Parameters +* **vehicle**: + diff --git a/VEHICLE/GetVehicleIsMercenary.md b/VEHICLE/GetVehicleIsMercenary.md index c371630fc..e1d6fbcb3 100644 --- a/VEHICLE/GetVehicleIsMercenary.md +++ b/VEHICLE/GetVehicleIsMercenary.md @@ -9,13 +9,10 @@ aliases: ["0xD4C4642CB7F50B5D"] BOOL GET_VEHICLE_IS_MERCENARY(Vehicle vehicle); ``` -``` -Only used like this: -if (VEHICLE::GET_VEHICLE_IS_MERCENARY(ENTITY::GET_VEHICLE_INDEX_FROM_ENTITY_INDEX(v_3))) { sub_157e9c(g_40001._f1868, 0); -} -``` +Returns whether the specified vehicle is designated as a mercenary vehicle ## Parameters -* **vehicle**: +* **vehicle**: The vehicle to check for mercenary status. ## Return value +Returns `true` if the vehicle is a mercenary vehicle, `false` otherwise. diff --git a/VEHICLE/N_0xb264c4d2f2b0a78b.md b/VEHICLE/N_0xb264c4d2f2b0a78b.md deleted file mode 100644 index 8af79f47e..000000000 --- a/VEHICLE/N_0xb264c4d2f2b0a78b.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -ns: VEHICLE ---- -## _0xB264C4D2F2B0A78B - -```c -// 0xB264C4D2F2B0A78B 0x45F72495 -void _0xB264C4D2F2B0A78B(Vehicle vehicle); -``` - -``` -This native doesn't seem to do anything, might be a debug-only native. -Confirmed, it is a debug native. -``` - -## Parameters -* **vehicle**: -