# PATH::GET_CLOSEST_ROAD

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

## Signature

```c
BOOL GET_CLOSEST_ROAD(float x, float y, float z, float p3, int p4, Vector3* p5, Vector3* p6, Any* p7, Any* p8, float* p9, BOOL p10);
```

## Parameters

- `x` (`float`)
- `y` (`float`)
- `z` (`float`)
- `p3` (`float`)
- `p4` (`int`)
- `p5` (`Vector3*`)
- `p6` (`Vector3*`)
- `p7` (`Any*`)
- `p8` (`Any*`)
- `p9` (`float*`)
- `p10` (`BOOL`)

## Returns

`BOOL`

## Usage

### Lua

```lua
local retval, p5, p6, p7, p8, p9 = GetClosestRoad(x, y, z, p3, p4, p10)

-- always available, by hash
local retval, p5, p6, p7, p8, p9 = Citizen.InvokeNative(0x132F52BBA570FE92, x, y, z, p3, p4, Citizen.PointerValueVector(), Citizen.PointerValueVector(), Citizen.PointerValueInt(), Citizen.PointerValueInt(), Citizen.PointerValueFloat(), p10, Citizen.ReturnResultAnyway())
```

### JavaScript

```js
const [retval, p5, p6, p7, p8, p9] = GetClosestRoad(x, y, z, p3, p4, p10);

// by hash
const [retval, p5, p6, p7, p8, p9] = Citizen.invokeNative('0x132F52BBA570FE92', x + 0.0000001, y + 0.0000001, z + 0.0000001, p3 + 0.0000001, p4, Citizen.pointerValueVector(), Citizen.pointerValueVector(), Citizen.pointerValueInt(), Citizen.pointerValueInt(), Citizen.pointerValueFloat(), p10, Citizen.returnResultAnyway());
```

### C#

```csharp
var p5 = new OutputArgument();
var p6 = new OutputArgument();
var p7 = new OutputArgument();
var p8 = new OutputArgument();
var p9 = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0x132F52BBA570FE92, x, y, z, p3, p4, p5, p6, p7, p8, p9, p10);
// p5.GetResult<Vector3>()
// p6.GetResult<Vector3>()
// p7.GetResult<int>()
// p8.GetResult<int>()
// p9.GetResult<float>()
```

- 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.
- Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.
- `Any*` arguments are often structs. Build them with a DataView buffer and pass it with `:Buffer()` — see the examples and notes below.

*Sources: alloc8or RDR3 NativeDB.*
