RedM Natives

GET_CLOSEST_ROAD

Hash0x132F52BBA570FE92
Runtime nameGetClosestRoad
NamespacePATH
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x132F52BBA570FE92

Signature

BOOL GET_CLOSEST_ROAD(float x, float y, float z, float p3, int p4, Vector3* p5, Vector3* p6, Any* p7, Any* p8, float* p9, BOOL p10);

Parameters

NameTypeDescription
xfloat—
yfloat—
zfloat—
p3float—
p4int—
p5Vector3*—
p6Vector3*—
p7Any*—
p8Any*—
p9float*—
p10BOOL—

Returns BOOL

Usage

Lua
local retval, p5, p6, p7, p8, p9 = GetClosestRoad(x, y, z, p3, p4, p10)

-- always works, by hash
local retval, p5, p6, p7, p8, p9 = Citizen.InvokeNative(0x132F52BBA570FE92, x, y, z, p3, p4, Citizen.PointerValueVector(), Citizen.PointerValueVector(), Citizen.PointerValueInt(), Citizen.PointerValueInt(), Citizen.PointerValueFloat(), p10, Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const [retval, p5, p6, p7, p8, p9] = GetClosestRoad(x, y, z, p3, p4, p10);

// by hash
const [retval, p5, p6, p7, p8, p9] = Citizen.invokeNative('0x132F52BBA570FE92', x + 0.0000001, y + 0.0000001, z + 0.0000001, p3 + 0.0000001, p4, Citizen.pointerValueVector(), Citizen.pointerValueVector(), Citizen.pointerValueInt(), Citizen.pointerValueInt(), Citizen.pointerValueFloat(), p10, Citizen.returnResultAnyway());
C#
var p5 = new OutputArgument();
var p6 = new OutputArgument();
var p7 = new OutputArgument();
var p8 = new OutputArgument();
var p9 = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0x132F52BBA570FE92, x, y, z, p3, p4, p5, p6, p7, p8, p9, p10);
// p5.GetResult<Vector3>()
// p6.GetResult<Vector3>()
// p7.GetResult<int>()
// p8.GetResult<int>()
// p9.GetResult<float>()
  • Float parameters: Lua integers (10, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write 10.0 or value + 0.0. The generated JS wrappers add 0.0000001 to 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.
  • Any* arguments are often structs. Build them with a DataView buffer and pass it with :Buffer() — see the examples and notes below.

Sources

alloc8or RDR3 NativeDB

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.