RedM Natives

TASK_LEAVE_VEHICLE

Flags from decompiled scripts: Others to be tried out: 320, 512, 131072.

Hash0x7B1141C6
Runtime nameTaskLeaveVehicle
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

void TASK_LEAVE_VEHICLE(Ped ped, Vehicle vehicle, int flags);

Parameters

NameTypeDescription
pedPed—
vehicleVehicle—
flagsint—

Returns void

Description

Cfx.re native reference

Flags from decompiled scripts:
0 = normal exit and closes door.
1 = normal exit and closes door.
16 = teleports outside, door kept closed.  (This flag does not seem to work for the front seats in buses, NPCs continue to exit normally)
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.

This is the server-side RPC native equivalent of the client native TASK_LEAVE_VEHICLE.

Usage

Lua
TaskLeaveVehicle(ped, vehicle, flags)

-- always works, by hash
Citizen.InvokeNative(0x7b1141c6, ped, vehicle, flags)
JavaScript and C#
JavaScript
TaskLeaveVehicle(ped, vehicle, flags);

// by hash
Citizen.invokeNative('0x7b1141c6', ped, vehicle, flags);
C#
Function.Call((Hash)0x7b1141c6, ped, vehicle, flags);

Sources

Cfx.re native reference

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