# getPathNodeNeighbours (Shared)

> Lists the nodes linked to a path node and what each link is like.

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

## Syntax

```lua
table|false getPathNodeNeighbours(int node)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `node` | `int` | A node id, as the other path functions return it. |

## Returns

A list with one table per link, or `false` if the node's area is not loaded.

Each table has `node` (the neighbour's id) and `length` (the link's length in metres). On a car node, when the link has lanes, also `lanesTo` (lanes from this node to the neighbour), `lanesFrom` (lanes from the neighbour to this node) and `trafficLight`. On a ped node, `crossesRoad` (the link crosses a road) and `pedTrafficLight`.

## Example

```lua
local position = getElementPosition(localPlayer)
local node = getClosestPathNode(position.x, position.y, position.z)
for _, link in ipairs(node and getPathNodeNeighbours(node) or {}) do
    if link.lanesTo and link.lanesTo > 0 then
        outputDebugString(("can drive to %d (%d m)"):format(link.node, link.length))
    end
end
```

## See also

- [getPathNodeInfo (Shared)](https://wiki.mymp.gg/en/getPathNodeInfo.md): Returns what is known about a path node.
- [calculatePathRoute (Shared)](https://wiki.mymp.gg/en/calculatePathRoute.md): Works out the shortest route along the path nodes between two points, starting from the node closest to each. For cars, it respects one-way streets.
