| 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 positiony(float) — y positionz(float) — z positionminimumEdgeLength(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 sourcetargetNode(Vector3*) — Position of the edge targetlaneCountForward(int*) — Lane count forwardlaneCountBackward(int*) — Lane count backwardswidth(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)