M MY Multiplayer: Wiki
Side
Kind

getPathNodesInRadius

Client

Lists the road or footpath nodes within a radius.

table getPathNodesInRadius(float x, y, z, float radius [, string type = car, bool water = false, int maxCount = 512])

Parameters

NameTypeDescription
x, y, zfloatThe circle's centre.
radiusfloatRadius in metres. A negative one raises an error.
typestringcar for roads, ped for footpaths.default car
waterbooltrue searches only the boat paths on water; false, only on land.default false
maxCountintThe most nodes to return. Below 1 raises an error.default 512

Returns

A list of node ids, empty if none is within the radius.

Example

local position = getElementPosition(localPlayer)
local nodes = getPathNodesInRadius(position.x, position.y, position.z, 100, "ped")
outputDebugString(#nodes .. " footpath nodes within 100 m")
NoteOnly nodes in loaded path areas count: those near the player, or requested with requestPathNodesInArea.

See also