_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).
Hash
0x3ACC128510142B9DRuntime name
CalculateWaypointDistanceFromStartNamespaceTASK
SideClient
NameCommunity guess
Docs
Since build1207
Signature
float _CALCULATE_WAYPOINT_DISTANCE_FROM_START(const char* waypointRecording, float x, float y, float z);Parameters
| Name | Type | Description |
|---|---|---|
waypointRecording | const char* | — |
x | float | — |
y | float | — |
z | float | — |
Returns float
Description
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.
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
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#
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());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. Write10.0orvalue + 0.0. The generated JS wrappers add0.0000001to 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
InvokeNativewith the hash — it always works.
Sources
alloc8or RDR3 NativeDB · VORPCORE RDR3natives
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.