# PATH::GET_CLOSEST_VEHICLE_NODE

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

## Signature

```c
BOOL GET_CLOSEST_VEHICLE_NODE(float x, float y, float z, Vector3* outPosition, int nodeType, float p5, float p6);
```

## Parameters

- `x` (`float`)
- `y` (`float`)
- `z` (`float`)
- `outPosition` (`Vector3*`)
- `nodeType` (`int`)
- `p5` (`float`)
- `p6` (`float`)

## Returns

`BOOL`

## Usage

### Lua

```lua
local retval, outPosition = GetClosestVehicleNode(x, y, z, nodeType, p5, p6)

-- always available, by hash
local retval, outPosition = Citizen.InvokeNative(0x240A18690AE96513, x, y, z, Citizen.PointerValueVector(), nodeType, p5, p6, Citizen.ReturnResultAnyway())
```

### JavaScript

```js
const [retval, outPosition] = GetClosestVehicleNode(x, y, z, nodeType, p5, p6);

// by hash
const [retval, outPosition] = Citizen.invokeNative('0x240A18690AE96513', x + 0.0000001, y + 0.0000001, z + 0.0000001, Citizen.pointerValueVector(), nodeType, p5 + 0.0000001, p6 + 0.0000001, Citizen.returnResultAnyway());
```

### C#

```csharp
var outPosition = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0x240A18690AE96513, x, y, z, outPosition, nodeType, p5, p6);
// outPosition.GetResult<Vector3>()
```

- 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.

*Sources: alloc8or RDR3 NativeDB.*
