GET_NTH_CLOSEST_VEHICLE_NODE
Hash
0x5A6D8DF6FBC5D0C4Runtime name
GetNthClosestVehicleNodeNamespacePATH
SideClient
NameOfficial
Docs
Since build1207
GTA V hash
0xE50E52416CCF948BSignature
BOOL GET_NTH_CLOSEST_VEHICLE_NODE(float x, float y, float z, int nthClosest, Vector3* outPosition, int unknown1, float unknown2, Any unknown3);Parameters
| Name | Type | Description |
|---|---|---|
x | float | — |
y | float | — |
z | float | — |
nthClosest | int | — |
outPosition | Vector3* | — |
unknown1 | int | — |
unknown2 | float | — |
unknown3 | Any | — |
Returns BOOL
Usage
local retval, outPosition = GetNthClosestVehicleNode(x, y, z, nthClosest, unknown1, unknown2, unknown3)
-- always works, by hash
local retval, outPosition = Citizen.InvokeNative(0x5A6D8DF6FBC5D0C4, x, y, z, nthClosest, Citizen.PointerValueVector(), unknown1, unknown2, unknown3, Citizen.ReturnResultAnyway())JavaScript and C#
const [retval, outPosition] = GetNthClosestVehicleNode(x, y, z, nthClosest, unknown1, unknown2, unknown3);
// by hash
const [retval, outPosition] = Citizen.invokeNative('0x5A6D8DF6FBC5D0C4', x + 0.0000001, y + 0.0000001, z + 0.0000001, nthClosest, Citizen.pointerValueVector(), unknown1, unknown2 + 0.0000001, unknown3, Citizen.returnResultAnyway());var outPosition = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0x5A6D8DF6FBC5D0C4, x, y, z, nthClosest, outPosition, unknown1, unknown2, unknown3);
// outPosition.GetResult<Vector3>()- 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.