GET_NTH_CLOSEST_VEHICLE_NODE_FAVOUR_DIRECTION
Hash
0x2FAC235A6062F14ARuntime name
GetNthClosestVehicleNodeFavourDirectionNamespacePATH
SideClient
NameOfficial
Docs
Since build1207
GTA V hash
0x45905BE8654AE067Signature
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
| Name | Type | Description |
|---|---|---|
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
local retval, outPosition, outHeading = GetNthClosestVehicleNodeFavourDirection(x, y, z, desiredX, desiredY, desiredZ, nthClosest, nodetype, p10, p11)
-- always works, 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 and C#
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());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. 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.