The Lab
PATH native

GET_NTH_CLOSEST_VEHICLE_NODE_FAVOUR_DIRECTION

returns BOOL12 paramsbuild 1207

Finds the Nth closest vehicle node, preferring nodes that face the desired point, and writes its position and heading.

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); // 0x2FAC235A6062F14A b1207

Parameters

#NameType
1xfloat
2yfloat
3zfloat
4desiredXfloat
5desiredYfloat
6desiredZfloat
7nthClosestint
8outPositionVector3* (out pointer)
9outHeadingfloat* (out pointer)
10nodetypeint
11p10Any
12p11Any

Facts

Facts about GET_NTH_CLOSEST_VEHICLE_NODE_FAVOUR_DIRECTION
Name
GET_NTH_CLOSEST_VEHICLE_NODE_FAVOUR_DIRECTION
Hash
0x2FAC235A6062F14A
Namespace
Returns
BOOL
Game build
1207

Examples

Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.

Lua
local result, outPosition, outHeading = Citizen.InvokeNative(0x2FAC235A6062F14A, -- GET_NTH_CLOSEST_VEHICLE_NODE_FAVOUR_DIRECTION
  0.0, -- float x
  0.0, -- float y
  0.0, -- float z
  0.0, -- float desiredX
  0.0, -- float desiredY
  0.0, -- float desiredZ
  0, -- int nthClosest
  Citizen.PointerValueVector(), -- Vector3* outPosition
  Citizen.PointerValueFloat(), -- float* outHeading
  0, -- int nodetype
  0, -- Any p10
  0, -- Any p11
  Citizen.ReturnResultAnyway()
)
if result then
  -- ...
end
JavaScript
// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const [result, outPosition, outHeading] = Citizen.invokeNative("0x2FAC235A6062F14A", // GET_NTH_CLOSEST_VEHICLE_NODE_FAVOUR_DIRECTION
  0.0, // float x
  0.0, // float y
  0.0, // float z
  0.0, // float desiredX
  0.0, // float desiredY
  0.0, // float desiredZ
  0, // int nthClosest
  Citizen.pointerValueVector(), // Vector3* outPosition
  Citizen.pointerValueFloat(), // float* outHeading
  0, // int nodetype
  0, // Any p10
  0, // Any p11
  Citizen.returnResultAnyway()
);
if (result) {
  // ...
}
C#
var outPositionArg = new OutputArgument();
var outHeadingArg = new OutputArgument();
bool result = Function.Call<bool>((Hash)0x2FAC235A6062F14A, // GET_NTH_CLOSEST_VEHICLE_NODE_FAVOUR_DIRECTION
  0.0f, // float x
  0.0f, // float y
  0.0f, // float z
  0.0f, // float desiredX
  0.0f, // float desiredY
  0.0f, // float desiredZ
  0, // int nthClosest
  outPositionArg, // Vector3* outPosition
  outHeadingArg, // float* outHeading
  0, // int nodetype
  0, // Any p10
  0 // Any p11
);
Vector3 outPosition = outPositionArg.GetResult<Vector3>();
float outHeading = outHeadingArg.GetResult<float>();
All PATH natives

Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.