M MY Multiplayer: Wiki
Side
Kind

getPathNodeInfo

Shared

Returns what is known about a path node.

table|false getPathNodeInfo(int node)

Parameters

NameTypeDescription
nodeintA 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: car or ped.
  • 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) and dontWander: booleans.
  • behaviour: roadblock or parking, 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

See also