GET_NTH_CLOSEST_VEHICLE_NODE_ID_WITH_HEADING
Returns the nth closest vehicle node with a heading to a coord
Hash
0x4114EAA8A7F7766DRuntime name
GetNthClosestVehicleNodeIdWithHeadingNamespacePATH
SideClient
NameOfficial
Docs
Since build1207
GTA V hash
0x6448050E9C2A7207Signature
int GET_NTH_CLOSEST_VEHICLE_NODE_ID_WITH_HEADING(float x, float y, float z, int nthClosest, float* returnHeading, int* returnNumLanes, int nodeFlags, float zMeasureMult, float zTolerance);Parameters
| Name | Type | Description |
|---|---|---|
x | float | — |
y | float | — |
z | float | — |
nthClosest | int | — |
returnHeading | float* | — |
returnNumLanes | int* | — |
nodeFlags | int | — |
zMeasureMult | float | — |
zTolerance | float | — |
Returns int
Description
Returns the nth closest vehicle node with a heading to a coord
Usage
local retval, returnHeading, returnNumLanes = GetNthClosestVehicleNodeIdWithHeading(x, y, z, nthClosest, nodeFlags, zMeasureMult, zTolerance)
-- always works, by hash
local retval, returnHeading, returnNumLanes = Citizen.InvokeNative(0x4114EAA8A7F7766D, x, y, z, nthClosest, Citizen.PointerValueFloat(), Citizen.PointerValueInt(), nodeFlags, zMeasureMult, zTolerance, Citizen.ResultAsInteger())JavaScript and C#
const [retval, returnHeading, returnNumLanes] = GetNthClosestVehicleNodeIdWithHeading(x, y, z, nthClosest, nodeFlags, zMeasureMult, zTolerance);
// by hash
const [retval, returnHeading, returnNumLanes] = Citizen.invokeNative('0x4114EAA8A7F7766D', x + 0.0000001, y + 0.0000001, z + 0.0000001, nthClosest, Citizen.pointerValueFloat(), Citizen.pointerValueInt(), nodeFlags, zMeasureMult + 0.0000001, zTolerance + 0.0000001, Citizen.returnResultAnyway(), Citizen.resultAsInteger());var returnHeading = new OutputArgument();
var returnNumLanes = new OutputArgument();
int retval = Function.Call<int>((Hash)0x4114EAA8A7F7766D, x, y, z, nthClosest, returnHeading, returnNumLanes, nodeFlags, zMeasureMult, zTolerance);
// returnHeading.GetResult<float>()
// returnNumLanes.GetResult<int>()- Float parameters: Lua integers (
10, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write10.0orvalue + 0.0. The generated JS wrappers add0.0000001to 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
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.