TasksClient

taskLeaveVehicle

TASK_LEAVE_VEHICLE0xD3DBCE61A490BE02

The GTA V native TASK_LEAVE_VEHICLE of the TASK namespace, as LS:MP client scripts call it: the global function taskLeaveVehicle, in JavaScript and in Lua.

SignatureJavaScript
taskLeaveVehicle(ped: Ped, vehicle: Vehicle, flags: number): void
SignatureLua
taskLeaveVehicle(ped: Ped, vehicle: Vehicle, flags: integer)

Usage

JavaScript
taskLeaveVehicle(ped, vehicle, flags);
Lua
taskLeaveVehicle(ped, vehicle, flags)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
vehicleVehiclenumberinteger
flagsintnumberinteger

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

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

Flags from decompiled scripts:
0 = normal exit and closes door.
1 = normal exit and closes door.
16 = teleports outside, door kept closed.
64 = normal exit and closes door, maybe a bit slower animation than 0.
256 = normal exit but does not close the door.
4160 = ped is throwing himself out, even when the vehicle is still.
262144 = ped moves to passenger seat first, then exits normally

Others to be tried out: 320, 512, 131072.

Reference

Namespace
Tasks TASK
In the game
void TASK_LEAVE_VEHICLE(Ped ped, Vehicle vehicle, int flags)
Hash
0xD3DBCE61A490BE02

Open in the interactive natives reference