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.
Signature
void TASK_GO_STRAIGHT_TO_COORD(Ped ped, float x, float y, float z, float speed, int timeout, float targetHeading, float distanceToSlide);Parameters
| Name | Type | Description |
|---|---|---|
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
This is the server-side RPC native equivalent of the client native TASK_GO_STRAIGHT_TO_COORD.
Usage
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#
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);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. 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.