TasksClient1 output

waypointRecordingGetClosestWaypoint

WAYPOINT_RECORDING_GET_CLOSEST_WAYPOINT0xB629A298081F876F

The GTA V native WAYPOINT_RECORDING_GET_CLOSEST_WAYPOINT of the TASK namespace, as LS:MP client scripts call it: the global function waypointRecordingGetClosestWaypoint, in JavaScript and in Lua.

SignatureJavaScript
waypointRecordingGetClosestWaypoint(
  name: string,
  x: number,
  y: number,
  z: number
): [ok: boolean, point: number]
SignatureLua
waypointRecordingGetClosestWaypoint(
  name: string,
  x: number,
  y: number,
  z: number
): boolean, integer

Usage

JavaScript
const [ok, point] = waypointRecordingGetClosestWaypoint(name, x, y, z);
Lua
local ok, point = waypointRecordingGetClosestWaypoint(name, x, y, z)

Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.

JavaScript · with vectors
const [ok, point] = waypointRecordingGetClosestWaypoint(name, pos);
Lua · with vectors
local ok, point = waypointRecordingGetClosestWaypoint(name, pos)

Parameters

ParameterTypeJavaScriptLua
namestringstringstring
xfloatnumbernumber
yfloatnumbernumber
zfloatnumbernumber

Returns

2 values, in this order: an array in JavaScript, multiple return values in Lua.

#ValueTypeJavaScriptLuaDescription
1okBOOLbooleanbooleanThe native’s own return value.
2pointintnumberintegeroutput

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Full list of waypoint recordings by DurtyFree: https://github.com/DurtyFree/gta-v-data-dumps/blob/master/waypointRecordings.json
For a full list of the points, see here: goo.gl/wIH0vn

Reference

Namespace
Tasks TASK
In the game
BOOL WAYPOINT_RECORDING_GET_CLOSEST_WAYPOINT(const char* name, float x, float y, float z, int* point)
Hash
0xB629A298081F876F

Open in the interactive natives reference