- Documentation
- Client events
- onClientWaypointRouteUpdate
Event
onClientWaypointRouteUpdate
The game recomputed the GPS route to the waypoint (the line on the radar), or the route disappeared. getPlayerWaypointRoute gives the route's points.
Handler
addEventHandler("onClientWaypointRouteUpdate", root, function(hasRoute, length) ... end)Parameters
hasRoutebooltrueif there is a route.lengthfloat- The route length in metres, or
false.
Source
source is the local player.
Example
addEventHandler("onClientWaypointRouteUpdate", localPlayer, function(hasRoute, length)
if hasRoute then outputChatBox(("Do celu %.1f km"):format(length / 1000)) end
end)
See also
getPlayerWaypointRouteReturns the game's GPS route to the waypoint, the line shown on the radar, as a list of points and a length in metres. The game computes a road route only while the player is in a vehicle.onClientWaypointSetThe local player has a new game GPS waypoint: from the map ("map") or from a script ("script").