RedM Natives

TASK_ENTER_VEHICLE

speed 1.0 = walk, 2.0 = run p5 1 = normal, 3 = teleport to vehicle, 8 = normal/carjack ped from seat, 16 = teleport directly into vehicle p6 is always 0 This is the server-side RPC native equivalent of the client native TASK_ENTER_VEHICLE.

Hash0xB8689B4E
Runtime nameTaskEnterVehicle
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

void TASK_ENTER_VEHICLE(Ped ped, Vehicle vehicle, int timeout, int seatIndex, float speed, int flag, Any p6);

Parameters

NameTypeDescription
pedPed—
vehicleVehicle—
timeoutint—
seatIndexint

See eSeatPosition declared in IS_VEHICLE_SEAT_FREE.

speedfloat—
flagint—
p6Any—

Returns void

Description

Cfx.re native reference

speed 1.0 = walk, 2.0 = run
p5 1 = normal, 3 = teleport to vehicle, 8 = normal/carjack ped from seat, 16 = teleport directly into vehicle
p6 is always 0

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

Usage

Lua
TaskEnterVehicle(ped, vehicle, timeout, seatIndex, speed, flag, p6)

-- always works, by hash
Citizen.InvokeNative(0xb8689b4e, ped, vehicle, timeout, seatIndex, speed, flag, p6)
JavaScript and C#
JavaScript
TaskEnterVehicle(ped, vehicle, timeout, seatIndex, speed, flag, p6);

// by hash
Citizen.invokeNative('0xb8689b4e', ped, vehicle, timeout, seatIndex, speed + 0.0000001, flag, p6);
C#
Function.Call((Hash)0xb8689b4e, ped, vehicle, timeout, seatIndex, speed, flag, p6);
  • Float parameters: Lua integers (10, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write 10.0 or value + 0.0. The generated JS wrappers add 0.0000001 to non-zero floats for the same reason.

Sources

Cfx.re native reference

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