Skip to content

Blip (tm.blip) ​

Client side only. Map blips for positions, entities and radius areas, with groups the player can hide together.

lua
local station = tm.blip.coords({
    coords = vec3(100.0, 200.0, 30.0),
    sprite = 60,
    color = 3,
    scale = 0.8,
    name = 'Police Station',
    group = 'police',
})

station:remove()

Creating ​

Each call takes a props table, which becomes the returned object (with id, kind, blipId and remove added).

CallDescription
tm.blip.coords(props)A blip at props.coords.
tm.blip.entity(props)A blip that follows props.entity. Raises an error when the entity does not exist.
tm.blip.radius(props)A circle at props.coords with props.radius.
PropDescription
nameLabel on the map. label is accepted too.
sprite, color, scaleBlip sprite, color (colour is accepted too, default 0) and scale (default 0.6).
displayDisplay mode, default 2.
shortShort range only, default true.
categoryBlip category.
alpha, rotation, priority0 to 255, degrees, draw order.
headingtrue shows a heading arrow.
distanceCoords and radius blips only exist on the map while the player is closer than this. Checked every 6 seconds.
groupBlips of one group can be hidden together.
icon, iconColorA custom icon (a name or an image URL) and its '#rrggbb' color, for map UIs that draw their own icons. The game blip still uses sprite.
Capitalized keysAny key like Flashes or Route calls the matching SetBlip<Key> native (a table value is unpacked into arguments).

Functions ​

CallDescription
tm.blip.remove(blip)Removes a blip. Takes the returned object or its id. Safe to call more than once. blip:remove() does the same.
tm.blip.setBlipInfo(handle, data)Changes an existing native blip (use blip.blipId). Only the fields in data change, and map UIs are told.
tm.blip.getBlip(id)The object for a registry id, or nil.
tm.blip.setGroupDisplay(group, display?)Sets the display mode of every blip in a group (stored, so it survives hiding and showing). nil re-applies the stored modes.
tm.blip.getGroupDisplay(group)The display mode of the first live blip in the group, 2 when there is none.
tm.blip.setGroupHidden(group, hidden)Hides or shows a group for every resource, and remembers it for resources that start later.
tm.blip.isGroupHidden(group)Whether the group is hidden.
tm.blip.registerGroup(id, label?)Names a group so a settings screen can offer "Show <label> blips".

Shared state and events ​

Each resource that imports tm.blip keeps its own registry of live blips. Hidden groups are shared through LocalPlayer.state.tmHiddenBlipGroups (not replicated) and the local event tm_lib:blip:groupHidden(group, hidden).

EventArgumentsWhen
tm_lib:blip:groupHiddengroup, hiddenA group was hidden or shown.
tm_lib:blip:groupRegisteredid, labelregisterGroup named a group.
tm_lib:blip:created / tm_lib:blip:updatedinfoA blip was made or changed. info is plain data (blipId, name, sprite, color, group, icon, ...).
tm_lib:blip:removedblipHandleA blip was removed.
tm_lib:blip:announceAllnoneTrigger it to make every resource announce its live blips again (a map UI that started late).
tm_lib:blip:refreshGroupgroup, display?Trigger it to call setGroupDisplay in every resource.