PedClient

isPedInAnyVehicle

IS_PED_IN_ANY_VEHICLE0x997ABD671D25CA0B

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

SignatureJavaScript
isPedInAnyVehicle(ped: Ped, atGetIn: boolean): boolean
SignatureLua
isPedInAnyVehicle(ped: Ped, atGetIn: boolean): boolean

Usage

JavaScript
const result = isPedInAnyVehicle(ped, atGetIn);
Lua
local result = isPedInAnyVehicle(ped, atGetIn)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
atGetInBOOLbooleanboolean

Returns

BOOL JavaScript boolean, Lua boolean

Notes

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

Gets a value indicating whether the specified ped is in any vehicle.

If 'atGetIn' is false, the function will not return true until the ped is sitting in the vehicle and is about to close the door. If it's true, the function returns true the moment the ped starts to get onto the seat (after opening the door). Eg. if false, and the ped is getting into a submersible, the function will not return true until the ped has descended down into the submersible and gotten into the seat, while if it's true, it'll return true the moment the hatch has been opened and the ped is about to descend into the submersible.

Reference

Namespace
Ped PED
In the game
BOOL IS_PED_IN_ANY_VEHICLE(Ped ped, BOOL atGetIn)
Hash
0x997ABD671D25CA0B

Open in the interactive natives reference