- Documentation
- Shared functions
- setPlayerRouteLine
Function
setPlayerRouteLine
Draws a custom route line on the player's ESC map instead of the game's GPS route, e.g. from getVehicleRoute or a walking route. It does not change the GPS target or blips. The line disappears after clearPlayerRouteLine and when the resource stops.
Syntax
bool setPlayerRouteLine(mixed ...)Arguments
...mixed- Server:
player, points[, color]; client:points[, color].
Returns
true on success.
Example
local points = getVehicleRoute(2495, -1667, 13, 1544, -1675, 13)
if points then setPlayerRouteLine(player, points, tocolor(0, 200, 255)) end
Notes
points is { {x, y [, z]}, ... } or { x1, y1, x2, y2, ... }, up to 20000 points; colour from tocolor, yellow by default. The radar still shows the game's route to the GPS target.
See also
clearPlayerRouteLineRemoves the line set bysetPlayerRouteLine. The ESC map goes back to the game's GPS route.getVehicleRouteFinds a car route along the game's roads between two points, respecting one-way streets and highway lanes. On the server it works immediately, with no players nearby. The client asks the server, so it only works insideasyncand waits up to 3 s.