# CFX::TASK_GO_STRAIGHT_TO_COORD

- **Hash:** `0x80A9E7A7`
- **Namespace:** CFX
- **Runtime name (Lua/JS):** `TaskGoStraightToCoord`
- **Side:** server (Cfx runtime native)
- **Name status:** official
- **Documentation:** described
- **URL:** https://natives.borderlinerp.com/natives/CFX/TASK_GO_STRAIGHT_TO_COORD

## Signature

```c
void TASK_GO_STRAIGHT_TO_COORD(Ped ped, float x, float y, float z, float speed, int timeout, float targetHeading, float distanceToSlide);
```

## Parameters

- `ped` (`Ped`) — The ped handle.
- `x` (`float`) — The x coordinate.
- `y` (`float`) — The y coordinate.
- `z` (`float`) — The z coordinate.
- `speed` (`float`) — The ped movement speed.
- `timeout` (`int`) — \-1 , other values appear to break the ped movement.
- `targetHeading` (`float`) — The heading you want the ped to be on x,y,z coord.
- `distanceToSlide` (`float`) — The distance from x,y,z where the ped will start sliding.

## Returns

`void`

## Description

*Source: Cfx.re native reference*

TASK_GO_STRAIGHT_TO_COORD

**This is the server-side RPC native equivalent of the client native [TASK_GO_STRAIGHT_TO_COORD](?\_0xD76B57B44F1E6F8B).**

## Usage

### Lua

```lua
TaskGoStraightToCoord(ped, x, y, z, speed, timeout, targetHeading, distanceToSlide)

-- always available, by hash
Citizen.InvokeNative(0x80a9e7a7, ped, x, y, z, speed, timeout, targetHeading, distanceToSlide)
```

### JavaScript

```js
TaskGoStraightToCoord(ped, x, y, z, speed, timeout, targetHeading, distanceToSlide);

// by hash
Citizen.invokeNative('0x80a9e7a7', ped, x + 0.0000001, y + 0.0000001, z + 0.0000001, speed + 0.0000001, timeout, targetHeading + 0.0000001, distanceToSlide + 0.0000001);
```

### C#

```csharp
Function.Call((Hash)0x80a9e7a7, ped, x, y, z, speed, timeout, targetHeading, distanceToSlide);
```

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