RedM Natives

TASK_GO_STRAIGHT_TO_COORD

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

Hash0x80A9E7A7
Runtime nameTaskGoStraightToCoord
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

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

Parameters

NameTypeDescription
pedPed

The ped handle.

xfloat

The x coordinate.

yfloat

The y coordinate.

zfloat

The z coordinate.

speedfloat

The ped movement speed.

timeoutint

-1 , other values appear to break the ped movement.

targetHeadingfloat

The heading you want the ped to be on x,y,z coord.

distanceToSlidefloat

The distance from x,y,z where the ped will start sliding.

Returns void

Description

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.

Usage

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

-- always works, by hash
Citizen.InvokeNative(0x80a9e7a7, ped, x, y, z, speed, timeout, targetHeading, distanceToSlide)
JavaScript and C#
JavaScript
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#
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

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