The Lab
PATH native

GET_CLOSEST_ROAD

returns BOOL11 paramsbuild 1207

Finds the closest road to the given point, writing its node positions and lane data to the output pointers and returning true on success.

Signature

C
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); // 0x132F52BBA570FE92 b1207

Parameters

#NameType
1xfloat
2yfloat
3zfloat
4p3float
5p4int
6p5Vector3* (out pointer)
7p6Vector3* (out pointer)
8p7Any* (out pointer)
9p8Any* (out pointer)
10p9float* (out pointer)
11p10BOOL

Facts

Facts about GET_CLOSEST_ROAD
Name
GET_CLOSEST_ROAD
Hash
0x132F52BBA570FE92
Namespace
Returns
BOOL
Game build
1207

Examples

Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.

Lua
local result, p5, p6, p7, p8, p9 = Citizen.InvokeNative(0x132F52BBA570FE92, -- GET_CLOSEST_ROAD
  0.0, -- float x
  0.0, -- float y
  0.0, -- float z
  0.0, -- float p3
  0, -- int p4
  Citizen.PointerValueVector(), -- Vector3* p5
  Citizen.PointerValueVector(), -- Vector3* p6
  Citizen.PointerValueInt(), -- Any* p7
  Citizen.PointerValueInt(), -- Any* p8
  Citizen.PointerValueFloat(), -- float* p9
  false, -- BOOL p10
  Citizen.ReturnResultAnyway()
)
if result then
  -- ...
end
JavaScript
// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const [result, p5, p6, p7, p8, p9] = Citizen.invokeNative("0x132F52BBA570FE92", // GET_CLOSEST_ROAD
  0.0, // float x
  0.0, // float y
  0.0, // float z
  0.0, // float p3
  0, // int p4
  Citizen.pointerValueVector(), // Vector3* p5
  Citizen.pointerValueVector(), // Vector3* p6
  Citizen.pointerValueInt(), // Any* p7
  Citizen.pointerValueInt(), // Any* p8
  Citizen.pointerValueFloat(), // float* p9
  false, // BOOL p10
  Citizen.returnResultAnyway()
);
if (result) {
  // ...
}
C#
var p5Arg = new OutputArgument();
var p6Arg = new OutputArgument();
var p7Arg = new OutputArgument();
var p8Arg = new OutputArgument();
var p9Arg = new OutputArgument();
bool result = Function.Call<bool>((Hash)0x132F52BBA570FE92, // GET_CLOSEST_ROAD
  0.0f, // float x
  0.0f, // float y
  0.0f, // float z
  0.0f, // float p3
  0, // int p4
  p5Arg, // Vector3* p5
  p6Arg, // Vector3* p6
  p7Arg, // Any* p7
  p8Arg, // Any* p8
  p9Arg, // float* p9
  false // BOOL p10
);
Vector3 p5 = p5Arg.GetResult<Vector3>();
Vector3 p6 = p6Arg.GetResult<Vector3>();
int p7 = p7Arg.GetResult<int>();
int p8 = p8Arg.GetResult<int>();
float p9 = p9Arg.GetResult<float>();
All PATH natives

Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.