GET_CLOSEST_ROAD
Hash
0x132F52BBA570FE92Runtime name
GetClosestRoadNamespacePATH
SideClient
NameOfficial
Docs
Since build1207
GTA V hash
0x132F52BBA570FE92Signature
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
| Name | Type | Description |
|---|---|---|
x | float | — |
y | float | — |
z | float | — |
p3 | float | — |
p4 | int | — |
p5 | Vector3* | — |
p6 | Vector3* | — |
p7 | Any* | — |
p8 | Any* | — |
p9 | float* | — |
p10 | BOOL | — |
Returns BOOL
Usage
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#
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());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. 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.
Any*arguments are often structs. Build them with a DataView buffer and pass it with:Buffer()— see the examples and notes below.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.