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
| Name | Type | Description |
|---|---|---|
| x, y, z | float | The circle's centre. |
| radius | float | Radius in metres. A negative one raises an error. |
| type | string | car for roads, ped for footpaths.default car |
| water | bool | true searches only the boat paths on water; false, only on land.default false |
| maxCount | int | The 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.