# TASK::WAYPOINT_RECORDING_GET_CLOSEST_WAYPOINT

- **Hash:** `0xB629A298081F876F`
- **Namespace:** TASK
- **Runtime name (Lua/JS):** `WaypointRecordingGetClosestWaypoint`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** named only
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/TASK/WAYPOINT_RECORDING_GET_CLOSEST_WAYPOINT

## Signature

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

## Parameters

- `waypointRecording` (`const char*`)
- `x` (`float`)
- `y` (`float`)
- `z` (`float`)
- `point` (`int*`)

## Returns

`BOOL`

## Usage

### Lua

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

-- always available, by hash
local retval, point = Citizen.InvokeNative(0xB629A298081F876F, waypointRecording, x, y, z, Citizen.PointerValueIntInitialized(point), Citizen.ReturnResultAnyway())
```

### JavaScript

```js
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#

```csharp
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.*
