RedM Natives

_CALCULATE_WAYPOINT_DISTANCE_FROM_START

Signed arclength (meters) from the start of a loaded waypoint recording to the point on the path nearest to (x,y,z).

Hash0x3ACC128510142B9D
Runtime nameCalculateWaypointDistanceFromStart
NamespaceTASK
SideClient
NameCommunity guess
Docs
Since build1207

Signature

float _CALCULATE_WAYPOINT_DISTANCE_FROM_START(const char* waypointRecording, float x, float y, float z);

Parameters

NameTypeDescription
waypointRecordingconst char*—
xfloat—
yfloat—
zfloat—

Returns float

Description

alloc8or RDR3 NativeDB

Signed arclength (meters) from the start of a loaded waypoint recording to the point on the path nearest to (x,y,z).
Negative before the first node; clamped to total length past the last node. Recording must be requested/loaded.

VORPCORE RDR3natives

Returns the signed distance along the waypoint recording from its start (first node) to the point on the recording that corresponds to coords
need REQUEST_WAYPOINT_RECORDING

Usage

Lua
local retval = CalculateWaypointDistanceFromStart(waypointRecording, x, y, z)

-- always works, by hash
local retval = Citizen.InvokeNative(0x3ACC128510142B9D, waypointRecording, x, y, z, Citizen.ResultAsFloat())
JavaScript and C#
JavaScript
const retval = CalculateWaypointDistanceFromStart(waypointRecording, x, y, z);

// by hash
const retval = Citizen.invokeNative('0x3ACC128510142B9D', waypointRecording, x + 0.0000001, y + 0.0000001, z + 0.0000001, Citizen.returnResultAnyway(), Citizen.resultAsFloat());
C#
float retval = Function.Call<float>((Hash)0x3ACC128510142B9D, waypointRecording, x, y, z);
  • 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.
  • The name is a community guess and may change. If the named call is missing in your client build, use InvokeNative with the hash — it always works.

Sources

alloc8or RDR3 NativeDB · VORPCORE RDR3natives

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