TASK_VEHICLE_DRIVE_TO_COORD
Hash
0xE2A2AA2F659D77A7Runtime name
TaskVehicleDriveToCoordNamespaceTASK
SideClient
NameOfficial
Docs
Since build1207
GTA V hash
0xE2A2AA2F659D77A7Signature
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
| Name | Type | Description |
|---|---|---|
ped | Ped | — |
vehicle | Vehicle | — |
x | float | — |
y | float | — |
z | float | — |
speed | float | — |
drivingStyle | int | — |
vehicleModel | Hash | — |
drivingMode | int | — |
stopRange | float | — |
straightLineDist | float | — |
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
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#
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);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.InvokeNativeneeds the number — passjoaat("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. Write10.0orvalue + 0.0. The generated JS wrappers add0.0000001to non-zero floats for the same reason.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.