# PATH::GET_NTH_CLOSEST_VEHICLE_NODE_FAVOUR_DIRECTION

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

## Signature

```c
BOOL GET_NTH_CLOSEST_VEHICLE_NODE_FAVOUR_DIRECTION(float x, float y, float z, float desiredX, float desiredY, float desiredZ, int nthClosest, Vector3* outPosition, float* outHeading, int nodetype, Any p10, Any p11);
```

## Parameters

- `x` (`float`)
- `y` (`float`)
- `z` (`float`)
- `desiredX` (`float`)
- `desiredY` (`float`)
- `desiredZ` (`float`)
- `nthClosest` (`int`)
- `outPosition` (`Vector3*`)
- `outHeading` (`float*`)
- `nodetype` (`int`)
- `p10` (`Any`)
- `p11` (`Any`)

## Returns

`BOOL`

## Usage

### Lua

```lua
local retval, outPosition, outHeading = GetNthClosestVehicleNodeFavourDirection(x, y, z, desiredX, desiredY, desiredZ, nthClosest, nodetype, p10, p11)

-- always available, by hash
local retval, outPosition, outHeading = Citizen.InvokeNative(0x2FAC235A6062F14A, x, y, z, desiredX, desiredY, desiredZ, nthClosest, Citizen.PointerValueVector(), Citizen.PointerValueFloat(), nodetype, p10, p11, Citizen.ReturnResultAnyway())
```

### JavaScript

```js
const [retval, outPosition, outHeading] = GetNthClosestVehicleNodeFavourDirection(x, y, z, desiredX, desiredY, desiredZ, nthClosest, nodetype, p10, p11);

// by hash
const [retval, outPosition, outHeading] = Citizen.invokeNative('0x2FAC235A6062F14A', x + 0.0000001, y + 0.0000001, z + 0.0000001, desiredX + 0.0000001, desiredY + 0.0000001, desiredZ + 0.0000001, nthClosest, Citizen.pointerValueVector(), Citizen.pointerValueFloat(), nodetype, p10, p11, Citizen.returnResultAnyway());
```

### C#

```csharp
var outPosition = new OutputArgument();
var outHeading = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0x2FAC235A6062F14A, x, y, z, desiredX, desiredY, desiredZ, nthClosest, outPosition, outHeading, nodetype, p10, p11);
// outPosition.GetResult<Vector3>()
// outHeading.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.

*Sources: alloc8or RDR3 NativeDB.*
