GET_NTH_CLOSEST_VEHICLE_NODE_FAVOUR_DIRECTION
Finds the Nth closest vehicle node, preferring nodes that face the desired point, and writes its position and heading.
Signature
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 b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | x | float |
| 2 | y | float |
| 3 | z | float |
| 4 | desiredX | float |
| 5 | desiredY | float |
| 6 | desiredZ | float |
| 7 | nthClosest | int |
| 8 | outPosition | Vector3* (out pointer) |
| 9 | outHeading | float* (out pointer) |
| 10 | nodetype | int |
| 11 | p10 | Any |
| 12 | p11 | Any |
Facts
| 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.
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// 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) {
// ...
}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>();Related PATH natives
- GET_NTH_CLOSEST_VEHICLE_NODE
- GET_NTH_CLOSEST_VEHICLE_NODE_ID
- GET_NTH_CLOSEST_VEHICLE_NODE_ID_WITH_HEADING
- GET_NTH_CLOSEST_VEHICLE_NODE_WITH_HEADING
- GET_CLOSEST_VEHICLE_NODE
- GET_CLOSEST_VEHICLE_NODE_WITH_HEADING
- GET_RANDOM_VEHICLE_NODE
- GET_VEHICLE_NODE_IS_SWITCHED_OFF
- GET_VEHICLE_NODE_POSITION
- GET_CLOSEST_ROAD
- _GET_SPAWN_DATA_FOR_ROAD_NODE
- IS_VEHICLE_NODE_ID_VALID
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.