Native referenceRedM

GET_CLOSEST_ROAD

0x132F52BBA570FE92 PATHFIND
FUNCTION SIGNATURE
Any GET_CLOSEST_ROAD(float x, float y, float z, float minimumEdgeLength, int minimumLaneCount, Vector3* srcNode, Vector3* targetNode, int* laneCountForward, int* laneCountBackward, float* width, BOOL onlyMajorRoads);
Property Value
Native Name GET_CLOSEST_ROAD
Hash 0x132F52BBA570FE92
Return Type bool
Build 1207
Parameters x (float), y (float), z (float), minimumEdgeLength (float), minimumLaneCount (int), srcNode (Vector3*), targetNode (Vector3*), laneCountForward (int*), laneCountBackward (int*), width (float*), onlyMajorRoads (BOOL)

Description: Finds an edge (node connection to another node) that satisfies the specified criteria.

Parameters

  • x (float) — x position
  • y (float) — y position
  • z (float) — z position
  • minimumEdgeLength (float) — Minimum distance the srcNode must be from the targetNode.
  • minimumLaneCount (int) — Minimum number of lanes the connection must have.
  • srcNode (Vector3*) — Position of the edge source
  • targetNode (Vector3*) — Position of the edge target
  • laneCountForward (int*) — Lane count forward
  • laneCountBackward (int*) — Lane count backwards
  • width (float*) — Width of gap in middle of road between forward and backward lanes.
  • onlyMajorRoads (BOOL) — Return major roads only.

Usage

Lua (Direct):

local result = GetClosestRoad(x, y, z, minimumEdgeLength, minimumLaneCount, srcNode, targetNode, laneCountForward, laneCountBackward, width, onlyMajorRoads)

Lua (Hash):

local result = Citizen.InvokeNative(0x132F52BBA570FE92, x, y, z, minimumEdgeLength, minimumLaneCount, srcNode, targetNode, laneCountForward, laneCountBackward, width, onlyMajorRoads)
Back to PATHFIND