M MY Multiplayer: Wiki
Side
Kind

getPathNodePosition

Shared

Returns a path node's position.

vec3|false getPathNodePosition(int node [, bool lane = false])

Parameters

NameTypeDescription
nodeintA node id, as the other path functions return it.
lanebooltrue 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

See also