GET_VEHICLE_PED_IS_IN
Gets the vehicle the specified Ped is/was in depending on bool value.
Signature
Vehicle GET_VEHICLE_PED_IS_IN(Ped ped, BOOL lastVehicle);Parameters
| Name | Type | Description |
|---|---|---|
ped | Ped | The target ped |
lastVehicle | BOOL | False = CurrentVehicle, True = LastVehicle |
Returns Vehicle — The vehicle id. Returns 0 if the ped is/was not in a vehicle.
Description
Gets the vehicle the specified Ped is/was in depending on bool value. This native is used server side when using OneSync.
Usage
local retval = GetVehiclePedIsIn(ped, lastVehicle)
-- always works, by hash
local retval = Citizen.InvokeNative(0xafe92319, ped, lastVehicle, Citizen.ResultAsInteger())JavaScript and C#
const retval = GetVehiclePedIsIn(ped, lastVehicle);
// by hash
const retval = Citizen.invokeNative('0xafe92319', ped, lastVehicle, Citizen.returnResultAnyway(), Citizen.resultAsInteger());int retval = Function.Call<int>((Hash)0xafe92319, ped, lastVehicle);Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.