PedClient

getVehiclePedIsIn

GET_VEHICLE_PED_IS_IN0x9A9112A0FE9A4713

The GTA V native GET_VEHICLE_PED_IS_IN of the PED namespace, as LS:MP client scripts call it: the global function getVehiclePedIsIn, in JavaScript and in Lua.

SignatureJavaScript
getVehiclePedIsIn(ped: Ped, includeEntering: boolean): Vehicle
SignatureLua
getVehiclePedIsIn(ped: Ped, includeEntering: boolean): Vehicle

Usage

JavaScript
const vehicle = getVehiclePedIsIn(ped, includeEntering);
Lua
local vehicle = getVehiclePedIsIn(ped, includeEntering)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
includeEnteringBOOLbooleanboolean

Returns

Vehicle JavaScript number, Lua integer

Game handle of a vehicle. Not an LS:MP netId. Convert one with lsmp.getEntityFromNetId.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Gets the vehicle the specified Ped is in. Returns 0 if the ped is/was not in a vehicle.

Reference

Namespace
Ped PED
In the game
Vehicle GET_VEHICLE_PED_IS_IN(Ped ped, BOOL includeEntering)
Hash
0x9A9112A0FE9A4713

Open in the interactive natives reference