waypointRecordingGetClosestWaypoint
WAYPOINT_RECORDING_GET_CLOSEST_WAYPOINT0xB629A298081F876FThe 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.
waypointRecordingGetClosestWaypoint(
name: string,
x: number,
y: number,
z: number
): [ok: boolean, point: number]waypointRecordingGetClosestWaypoint(
name: string,
x: number,
y: number,
z: number
): boolean, integerUsage
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
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
name | string | string | string |
x | float | number | number |
y | float | number | number |
z | float | number | number |
Returns
2 values, in this order: an array in JavaScript, multiple return values in Lua.
| # | Value | Type | JavaScript | Lua | Description |
|---|---|---|---|---|---|
| 1 | ok | BOOL | boolean | boolean | The native’s own return value. |
| 2 | point | int | number | integer | output |
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