RedM Natives

WAYPOINT_RECORDING_GET_CLOSEST_WAYPOINT

Hash0xB629A298081F876F
Runtime nameWaypointRecordingGetClosestWaypoint
NamespaceTASK
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0xB629A298081F876F

Signature

BOOL WAYPOINT_RECORDING_GET_CLOSEST_WAYPOINT(const char* waypointRecording, float x, float y, float z, int* point);

Parameters

NameTypeDescription
waypointRecordingconst char*—
xfloat—
yfloat—
zfloat—
pointint*—

Returns BOOL

Usage

Lua
local retval, point = WaypointRecordingGetClosestWaypoint(waypointRecording, x, y, z, point)

-- always works, by hash
local retval, point = Citizen.InvokeNative(0xB629A298081F876F, waypointRecording, x, y, z, Citizen.PointerValueIntInitialized(point), Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const [retval, point] = WaypointRecordingGetClosestWaypoint(waypointRecording, x, y, z, point);

// by hash
const [retval, point] = Citizen.invokeNative('0xB629A298081F876F', waypointRecording, x + 0.0000001, y + 0.0000001, z + 0.0000001, Citizen.pointerValueIntInitialized(point), Citizen.returnResultAnyway());
C#
var point = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0xB629A298081F876F, waypointRecording, x, y, z, point);
// point.GetResult<int>()
  • 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 last argument is an in/out pointer: pass its initial value, and the updated value is returned after the result.

Sources

alloc8or RDR3 NativeDB

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