# TASK::TASK_VEHICLE_DRIVE_TO_COORD

- **Hash:** `0xE2A2AA2F659D77A7`
- **Namespace:** TASK
- **Runtime name (Lua/JS):** `TaskVehicleDriveToCoord`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/TASK/TASK_VEHICLE_DRIVE_TO_COORD

## Signature

```c
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

- `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

### Lua

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

-- always available, by hash
Citizen.InvokeNative(0xE2A2AA2F659D77A7, ped, vehicle, x, y, z, speed, drivingStyle, vehicleModel, drivingMode, stopRange, straightLineDist)
```

### JavaScript

```js
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#

```csharp
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.*
