RedM Natives

TASK_VEHICLE_DRIVE_TO_COORD

Hash0xE2A2AA2F659D77A7
Runtime nameTaskVehicleDriveToCoord
NamespaceTASK
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0xE2A2AA2F659D77A7

Signature

void TASK_VEHICLE_DRIVE_TO_COORD(Ped ped, Vehicle vehicle, float x, float y, float z, float speed, int drivingStyle, Hash vehicleModel, int drivingMode, float stopRange, float straightLineDist);

Parameters

NameTypeDescription
pedPed—
vehicleVehicle—
xfloat—
yfloat—
zfloat—
speedfloat—
drivingStyleint—
vehicleModelHash—
drivingModeint—
stopRangefloat—
straightLineDistfloat—

Returns void

Description

stopRange: how close vehicle will get to destination before stopping, default 4.0
straightLineDist: distance at which AI switches to heading for target directly instead of following nodes, default -1

Usage

Lua
TaskVehicleDriveToCoord(ped, vehicle, x, y, z, speed, drivingStyle, vehicleModel, drivingMode, stopRange, straightLineDist)

-- always works, by hash
Citizen.InvokeNative(0xE2A2AA2F659D77A7, ped, vehicle, x, y, z, speed, drivingStyle, vehicleModel, drivingMode, stopRange, straightLineDist)
JavaScript and C#
JavaScript
TaskVehicleDriveToCoord(ped, vehicle, x, y, z, speed, drivingStyle, vehicleModel, drivingMode, stopRange, straightLineDist);

// by hash
Citizen.invokeNative('0xE2A2AA2F659D77A7', ped, vehicle, x + 0.0000001, y + 0.0000001, z + 0.0000001, speed + 0.0000001, drivingStyle, vehicleModel, drivingMode, stopRange + 0.0000001, straightLineDist + 0.0000001);
C#
Function.Call((Hash)0xE2A2AA2F659D77A7, ped, vehicle, x, y, z, speed, drivingStyle, vehicleModel, drivingMode, stopRange, straightLineDist);
  • Hash parameters: the named function also accepts a string and hashes it for you; Citizen.InvokeNative needs the number — pass joaat("name") or a backtick literal like `name`.
  • 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

alloc8or RDR3 NativeDB

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