getPathNodeInfo
Shared
Returns what is known about a path node.
table|false getPathNodeInfo(int node)
Parameters
| Name | Type | Description |
|---|---|---|
| node | int | A node id, as the other path functions return it. |
Returns
A table with the fields below, or false if the node's area is not loaded.
type:carorped.position: the node's position.width: the path's width in metres.links: how many nodes are linked to it.group: nodes in different groups have no route between them.spawnProbability: from 0 to 15, how likely peds or cars are to appear there.water,interior,switchedOff(closed to traffic) anddontWander: booleans.behaviour:roadblockorparking, missing on other nodes.
Example
local position = getElementPosition(localPlayer)
local node = getClosestPathNode(position.x, position.y, position.z)
local info = node and getPathNodeInfo(node)
if info and not info.switchedOff then
outputDebugString(("road %.1f m wide with %d links"):format(info.width, info.links))
end