RedM Natives

GET_VEHICLE_PED_IS_IN

Gets the vehicle the specified Ped is/was in depending on bool value.

Hash0xAFE92319
Runtime nameGetVehiclePedIsIn
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

Vehicle GET_VEHICLE_PED_IS_IN(Ped ped, BOOL lastVehicle);

Parameters

NameTypeDescription
pedPed

The target ped

lastVehicleBOOL

False = CurrentVehicle, True = LastVehicle

Returns Vehicle — The vehicle id. Returns 0 if the ped is/was not in a vehicle.

Description

Cfx.re native reference

Gets the vehicle the specified Ped is/was in depending on bool value. This native is used server side when using OneSync.

Usage

Lua
local retval = GetVehiclePedIsIn(ped, lastVehicle)

-- always works, by hash
local retval = Citizen.InvokeNative(0xafe92319, ped, lastVehicle, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = GetVehiclePedIsIn(ped, lastVehicle);

// by hash
const retval = Citizen.invokeNative('0xafe92319', ped, lastVehicle, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
int retval = Function.Call<int>((Hash)0xafe92319, ped, lastVehicle);

Sources

Cfx.re native reference

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.