# getPathNodesInRadius (Shared)

> Lists the road or footpath nodes within a radius.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Roads and paths
- **URL**: https://wiki.mymp.gg/en/getPathNodesInRadius

## Syntax

```lua
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

```lua
local position = getElementPosition(localPlayer)
local nodes = getPathNodesInRadius(position.x, position.y, position.z, 100, "ped")
outputDebugString(#nodes .. " footpath nodes within 100 m")
```

### Note

Only nodes in loaded path areas count: those near the player, or requested with `requestPathNodesInArea`.

## See also

- [getClosestPathNode (Shared)](https://wiki.mymp.gg/en/getClosestPathNode.md): Finds the road or footpath node closest to a point.
- [getPathNodeInfo (Shared)](https://wiki.mymp.gg/en/getPathNodeInfo.md): Returns what is known about a path node.
- [getPathNodePosition (Shared)](https://wiki.mymp.gg/en/getPathNodePosition.md): Returns a path node's position.
