getPathNodePosition
Shared
Returns a path node's position.
vec3|false getPathNodePosition(int node [, bool lane = false])
Parameters
| Name | Type | Description |
|---|---|---|
| node | int | A node id, as the other path functions return it. |
| lane | bool | true moves the position off the middle of a road with a median to one side, where SA's scripts place cars.default false |
Returns
The node's position, or false if the node's area is not loaded.
Example
local position = getElementPosition(localPlayer)
local node = getClosestPathNode(position.x, position.y, position.z)
if node then
local lane = getPathNodePosition(node, true)
setElementPosition(localPlayer, lane.x, lane.y, lane.z + 1)
end