Commands and Exports — Waypoint Developer API | Quasar Store Docs | Quasar Store
Documentation
Commands and Exports
Every Waypoint command and keybind, the waypointdebug readout, and the client exports for FiveM scripts: AddWaypoint, RemoveWaypoint, ClearWaypoints, GetWaypoints, SetProfile and GetProfiles.
The creator is also registered in FiveM's key settings as Waypoint creator, under Settings → Key Bindings → FiveM. Config.Keybind sets the key it starts on — for example "F7". Left empty, it starts unbound and each player chooses their own.
FiveM remembers each player's binding. Config.Keybind is only the default for players who have never seen the binding — changing it later does not move the key for players who already have one.
Set a waypoint, drive towards it, and run the command. Every safety check on the route can only ever remove arrows, so when the trail is shorter than expected, the large number is the one that explains it:
Line
Means
icon texture ready
Whether the icon loaded. false means no icon can be drawn — see Common Errors.
targets · route on · performance mode
How many points are being drawn, whether the active profile has the route on, and which preset is running.
destination is … m away
The route only exists between 40 m and 4 km (3 km in performance mode).
road nodes walked
How many road points the route was built from. Near zero means there is no road to follow from where the player stands.
arrow positions considered
How many arrows the route could have had.
dropped, off the ground line
Arrows that would have landed on a roof, a bridge deck or a tunnel ceiling.
dropped, not on a road
Arrows off the tarmac. Zero with the shipped settings.
dropped, wall in the way
Arrows behind a wall. Zero with the shipped settings.
arrows drawn · at cursor
Arrows in the finished route, and which one is nearest the player.
For marking points from your own scripts — a delivery job, a dispatch call, a mission, a treasure hunt — and for switching the player's style. All six are client-side and return immediately. From the server, trigger a client event and call them there; see Integrations for worked examples.
AddWaypoint
lua
local ok = exports['qs-waypoint']:AddWaypoint(id, coords, options)
-- In the player's own style
exports['qs-waypoint']:AddWaypoint('mytaxi:pickup', vector3(215.8, -810.1, 30.7))
-- With a label over the icon and a colour of its own
exports['qs-waypoint']:AddWaypoint('mytaxi:pickup', vector3(215.8, -810.1, 30.7), {
label = 'Customer',
style = { color = { 250, 204, 21 }, markerColor = { 250, 204, 21 } },
})
Marks a point until it is removed. Returns true, or false when the id is missing or the coordinates have no x, y and z.
Argument
Type
Description
id
string or number
Your name for the point, used to remove it. Adding with an id that already exists replaces that point.
coords
vector3 or { x, y, z }
Where to draw it. The z is used as given, so pass the ground height.
The 1.x form { color = { r, g, b, a } } is still accepted: it colours the icon and the marker and uses the fourth value as the opacity.
RemoveWaypoint · ClearWaypoints
lua
-- One point. true if it existed, false if there was nothing with that idlocal removed = exports['qs-waypoint']:RemoveWaypoint('mytaxi:pickup')
-- Every point added through the exports, by any resource. Always true
exports['qs-waypoint']:ClearWaypoints()
Neither touches the player's own map waypoint. ClearWaypoints removes the points of every resource, not just yours — prefer removing your own ids.
GetWaypoints
lua
local points = exports['qs-waypoint']:GetWaypoints()
for id, point inpairs(points) doprint(id, point.coords, point.label)
end
A copy of every point added through the exports, keyed by id, each with its coords and label. Changing the copy changes nothing on screen. The player's map waypoint is not included.
SetProfile · GetProfiles
lua
-- Every saved profile of this player: { { id = 'p…', name = 'Default' }, … }local profiles = exports['qs-waypoint']:GetProfiles()
-- Make one active, by name or by id. false if the player has none by that namelocal switched = exports['qs-waypoint']:SetProfile('Police')
Switching is saved, exactly as if the player had clicked the profile in the creator, and every point on screen takes the new style at once. Names are matched exactly, capitals included.
There are none, by design. Waypoint draws on each player's screen, so a server script decides what to mark and tells that player's client with TriggerClientEvent, which then calls the exports above. Waypoint emits no events of its own and needs none.
options.label
string, optional
Text drawn above the icon while the destination is on screen.
options.style
table, optional
Any fields from the Styling Reference, merged over the player's active style for this point only. The icon itself cannot be changed per point.