client runtime · Lua API
Open77.blips
Runs inside the game process. Reads and presentation are local; anything that changes shared state has to go through the server.
On this page24 sections
attachToEntity
Open77.blips.attachToEntity(id, entity, [slot], [offset])Makes a blip follow an Open77 entity.
Changes an owned blip from a fixed world position to tracking a streamed Open77 entity. The entity id is ephemeral and the call requires ui.vanilla.map; remove or reattach the blip when its gameplay target changes.
Parameters 4
| Name | Type | Use | Default |
|---|---|---|---|
id | decimal string | required | — |
entity | entity | required | — |
slot | string | optional | poi_mappin |
offset | table { x, y, z } | optional | — |
Returns
- boolean
- reason
Example
-- The delivery car's blip follows the car
local blip = Open77.blips.create({ position = car.position, sprite = "vehicle", label = "Delivery car" })
Open77.blips.attachToEntity(blip, car.entity)Custom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipAttachToEntity (line 25462).
clear
Open77.blips.clear()Removes every blip owned by the current resource.
Removes every vanilla-map blip owned by the calling resource generation. Other resources' blips are left untouched, and generation teardown performs the same cleanup automatically.
Returns
- true
Example
-- The heist is over: drop every blip this resource placed
AddEventHandler("heist:ended", function()
Open77.blips.clear()
end)Custom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipClear (line 25483).
clearWaypoint
Open77.blips.clearWaypoint()Clears the player's map waypoint, whoever set it.
Untracks the waypoint, including one the player placed themselves, which is what DeleteWaypoint means, and destroys the pin only when this resource owns it; another resource's pin stays registered. Clearing when there was no waypoint is a success that reports false as its second value, so a caller reconciling state can tell the two apart without an error. Requires ui.vanilla.map.
Returns
- true
- whether a waypoint was actually cleared
- reason on failure: permission_denied:ui.vanilla.map, waypoint_unavailable_on_this_host, wrong_thread, world_unavailable
Example
-- The taxi fare is cancelled: remove the route
local ok, wasSet = Open77.blips.clearWaypoint()
if ok and wasSet then exports.open77_chat:addMessage("Route cancelled.") endCustom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipClearWaypoint (line 25481).
create
Open77.blips.create(options)Creates a resource-owned vanilla map pin.
Requires ui.vanilla.map. Provide exactly one of position or entity. Set routable = true on a positional blip to use Cyberpunk's trusted custom-waypoint definition; its sprite becomes CustomPositionVariant and track(id) can then start native GPS routing. The returned 64-bit generation handle is a decimal string and is cleaned up automatically when the resource stops. Experimental SVG icons and per-blip RGB/RGBA colors require the matching native client adapter. Declare SVG assets in the manifest; use icon = { asset, size } and color = "#RRGGBB" or "#RRGGBBAA". PNG blip icons are not supported by this adapter.
Parameters 1
| Name | Type | Use | Default |
|---|---|---|---|
options | table { position|entity, sprite?, title?, description?, label?, icon?, color?, range?, active?, visibleThroughWalls?, routable?, slot?, offset? } | required | — |
Returns
- decimal-string blip id, or nil
- reason
Example
local id = assert(Open77.blips.create({
position = { x = 10, y = 20, z = 30 },
routable = true, label = "Street race"
}))
assert(Open77.blips.track(id))Custom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipCreate (line 23005).
get
Open77.blips.get(id)Reads one blip owned by the current resource.
Returns a read-only snapshot of one blip owned by the calling resource. The handle must still belong to the current generation; a stale or foreign id is rejected.
Parameters 1
| Name | Type | Use | Default |
|---|---|---|---|
id | decimal string | required | — |
Returns
- snapshot table, or nil
- reason
Example
-- Is the blip still active?
local blip = Open77.blips.get(blipId)
if blip and not blip.active then Open77.blips.setActive(blipId, true) endCustom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipGet (line 25484).
list
Open77.blips.list()Lists blips owned by the current resource.
Lists snapshots of all vanilla-map blips owned by the calling resource generation. The returned tables are copies and changing them does not mutate the map.
Returns
- array of snapshot tables
Example
-- Print every blip this resource owns
for _, blip in ipairs(Open77.blips.list()) do
print(blip.id, blip.label)
endCustom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipList (line 25485).
remove
Open77.blips.remove(id)Removes one owned blip.
Deletes one blip owned by the calling resource and invalidates its handle. Removal is resource-scoped, so one package cannot erase another package's map state.
Parameters 1
| Name | Type | Use | Default |
|---|---|---|---|
id | decimal string | required | — |
Returns
- boolean
- reason
Example
-- The package was delivered: remove its map pin
RegisterNetEvent("delivery:done", function()
Open77.blips.remove(deliveryBlip)
end)Custom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipRemove (line 25482).
setActive
Open77.blips.setActive(id, active)Activates or deactivates a vanilla mappin.
Updates the active/highlighted state of an owned vanilla-map blip. This changes presentation only and does not create a route or change server state.
Parameters 2
| Name | Type | Use | Default |
|---|---|---|---|
id | decimal string | required | — |
active | boolean | required | — |
Returns
- boolean
- reason
Example
-- Highlight the shop blip only while it is open
RegisterNetEvent("shop:hours", function(open)
Open77.blips.setActive(shopBlip, open)
end)Custom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipSetActive (line 25469).
setColor
Open77.blips.setColor(id, color)Sets an owned blip color or restores its source colors.
Experimental per-blip styling; requires the matching native client adapter. Accepts exactly #RRGGBB, #RRGGBBAA or false to clear the override. Works with native sprites and custom SVGs without changing other blips sharing the sprite. For SVGs it replaces RGB and multiplies each painted shape's source alpha. Clearing the icon does not clear this override; visual-only updates preserve native tracking.
Parameters 2
| Name | Type | Use | Default |
|---|---|---|---|
id | decimal string | required | — |
color | string|false | required | — |
Returns
- boolean
- reason
Example
assert(Open77.blips.setColor(jobBlip, "#FFCC0080"))
assert(Open77.blips.setColor(jobBlip, false))Custom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipSetColor (line 24507).
setDescription
Open77.blips.setDescription(id, description)Sets the custom fullscreen-map description of an owned blip.
Requires ui.vanilla.map. The description is displayed by Open77's fullscreen-map tooltip for the selected native mappin.
Parameters 2
| Name | Type | Use | Default |
|---|---|---|---|
id | string | required | — |
description | string | required | — |
Returns
- true on success, otherwise false
- reason
Example
-- A tooltip with the shop's opening hours on the fullscreen map
Open77.blips.setDescription(shopBlip, "Open 20:00 - 04:00. Cash only.")Custom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipSetDescription (line 25466).
setIcon
Open77.blips.setIcon(id, icon)Sets a declared SVG icon or restores the native sprite.
Experimental native SVG adapter; requires the matching OPEN//77 client and Cyberpunk 2077 2.31. Accepts a declared resource-relative .svg path, { asset, size }, or false to restore the native sprite. Size is 16–128 native Ink units (default 48). Color overrides remain when the icon is cleared. Visual-only edits preserve tracking; malformed or unsupported SVG leaves the existing icon unchanged. URLs and PNG/WebP are rejected.
Parameters 2
| Name | Type | Use | Default |
|---|---|---|---|
id | decimal string | required | — |
icon | string|table|false | required | — |
Returns
- boolean
- reason
Example
local ok, reason = Open77.blips.setIcon(hqBlip, { asset = "icons/gang.svg", size = 48 })
if not ok then print(reason) end
Open77.blips.setIcon(hqBlip, false)Custom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipSetIcon (line 23013).
setLabel
Open77.blips.setLabel(id, label)Changes the fullscreen-map tooltip title.
Open77 keeps the label in private script data, independent from the vanilla variant's generic title.
Parameters 2
| Name | Type | Use | Default |
|---|---|---|---|
id | decimal string | required | — |
label | string | required | — |
Returns
- boolean
- reason
Example
-- Rename the blip as the job progresses
Open77.blips.setLabel(jobBlip, "Pick up the package")Custom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipSetLabel (line 25465).
setPosition
Open77.blips.setPosition(id, position)Moves a blip to a world position.
Also detaches an entity-following blip.
Parameters 2
| Name | Type | Use | Default |
|---|---|---|---|
id | decimal string | required | — |
position | table { x, y, z } | required | — |
Returns
- boolean
- reason
Example
-- Move the "next checkpoint" blip as the race progresses
RegisterNetEvent("race:checkpoint", function(position)
Open77.blips.setPosition(checkpointBlip, position)
end)Custom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipSetPosition (line 25461).
setRange
Open77.blips.setRange(id, metres)Switches a blip off beyond a distance and back on when the player returns.
Requires ui.vanilla.map. metres is 0..4000; false or 0 clears the gate. This is Open77's own distance test driving the vanilla SetMappinActive, not a mappin property: gamemappinsMappinData has no range field. It is therefore NOT FiveM's SetBlipAsShortRange, which hides a blip from the minimap only -- 2.31 offers no per-surface control, so out of range means off on the HUD, the minimap and the world map alike. It composes with active rather than overriding it. An entity-following blip is measured from the body it follows, and keeps its last state while that body is not streamed in.
Parameters 2
| Name | Type | Use | Default |
|---|---|---|---|
id | decimal string | required | — |
metres | number or false | required | — |
Returns
- boolean
- reason
Example
-- The vendor blip only shows within 300 m
Open77.blips.setRange(vendorBlip, 300)Custom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipSetRange (line 25471).
setSprite
Open77.blips.setSprite(id, sprite)Changes the vanilla mappin variant.
Accepts an exact 2.31 variant name, a stable alias, or an integer from 0 through 146. See wiki/blips.md for the complete list.
Parameters 2
| Name | Type | Use | Default |
|---|---|---|---|
id | decimal string | required | — |
sprite | string|integer | required | — |
Returns
- boolean
- reason
Example
-- Turn the marker red once the zone becomes dangerous
Open77.blips.setSprite(zoneBlip, "danger")Custom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipSetSprite (line 25463).
setTitle
Open77.blips.setTitle(id, title)Sets the custom fullscreen-map title of an owned blip.
Requires ui.vanilla.map. This is the semantic title alias of setLabel; the HUD does not permanently render it beside the icon.
Parameters 2
| Name | Type | Use | Default |
|---|---|---|---|
id | string | required | — |
title | string | required | — |
Returns
- true on success, otherwise false
- reason
Example
-- Title shown when the blip is selected on the fullscreen map
Open77.blips.setTitle(garageBlip, "Your garage")Custom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipSetTitle (line 25464).
setTrackingAlternative
Open77.blips.setTrackingAlternative(id, target)Sets another owned blip as the routing alternative.
Passing nil clears it. This does not force the world-map controller to start tracking.
Parameters 2
| Name | Type | Use | Default |
|---|---|---|---|
id | decimal string | required | — |
target | decimal string|nil | required | — |
Returns
- boolean
- reason
Example
-- Route to the back entrance if the front is tracked
Open77.blips.setTrackingAlternative(frontDoorBlip, backDoorBlip)Custom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipSetTrackingAlternative (line 25472).
setVisibleThroughWalls
Open77.blips.setVisibleThroughWalls(id, visible)Changes vanilla through-wall visibility.
Controls whether an owned world marker remains visible when geometry occludes it. The setting affects presentation on this client only and requires ui.vanilla.map.
Parameters 2
| Name | Type | Use | Default |
|---|---|---|---|
id | decimal string | required | — |
visible | boolean | required | — |
Returns
- boolean
- reason
Example
-- Team-mates stay visible through buildings
Open77.blips.setVisibleThroughWalls(teamBlip, true)Custom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipSetVisibleThroughWalls (line 25470).
setWaypoint
Open77.blips.setWaypoint(position)Places the player's map waypoint, replacing whatever was tracked.
Registers a routable custom-position mappin and makes it the tracked destination, so the vanilla GPS calculates a road route to it exactly as it does for a waypoint the player set by hand. The pin is owned by the calling resource and is destroyed when that resource stops, so a crashed taxi script leaves no permanent arrow on the map. Calling it again moves the same pin rather than registering a second one. Requires ui.vanilla.map.
Parameters 1
| Name | Type | Use | Default |
|---|---|---|---|
position | table { x, y, z } | required | — |
Returns
- true
- reason on failure: permission_denied:ui.vanilla.map, invalid_position, waypoint_unavailable_on_this_host, too_many_blips, wrong_thread, world_unavailable
Example
-- The taxi order sets the customer's GPS to the pickup point
RegisterNetEvent("taxi:pickup", function(position)
Open77.blips.setWaypoint(position)
end)Custom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipSetWaypoint (line 25480).
sprites
Open77.blips.sprites()Lists every usable mappin variant in the current build.
Returns 147 entries for Cyberpunk 2077 2.31. This metadata query does not require map mutation permission.
Returns
- array of { name, value }
Example
-- Print every usable sprite name once
for _, sprite in ipairs(Open77.blips.sprites()) do
print(sprite.value, sprite.name)
endCustom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipSprites (line 25486).
track
Open77.blips.track(id)Selects this blip as the vanilla manually tracked destination.
Follows the same internal MappinSystem operation as selecting a pin on the fullscreen map. This changes the tracked id; native road calculation additionally requires the blip to have been created with routable = true. Returns changed = false when this blip is already tracked.
Parameters 1
| Name | Type | Use | Default |
|---|---|---|---|
id | decimal string | required | — |
Returns
- true
- whether tracking changed
- reason on failure
Example
-- Start GPS routing to the race start
local blip = Open77.blips.create({ position = raceStart, routable = true, label = "Street race" })
Open77.blips.track(blip)Custom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipTrack (line 25473).
untrack
Open77.blips.untrack(id)Safely clears manual tracking for this blip.
The native action is invoked only if this owned blip is currently tracked, so a resource cannot untrack a quest or another system's pin.
Parameters 1
| Name | Type | Use | Default |
|---|---|---|---|
id | decimal string | required | — |
Returns
- true
- whether it was tracked
Example
-- Stop routing once the player arrives
RegisterNetEvent("race:arrived", function()
Open77.blips.untrack(raceBlip)
end)Custom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipUntrack (line 25474).
update
Open77.blips.update(id, patch)Updates several properties of an owned blip.
Updates mutable fields on an owned blip. Visual-only icon/color changes preserve its native identity and tracking selection. Structural changes register a replacement before removing the previous mappin. position switches to positional mode; entity switches to attached mode. routable cannot be changed. Invalid SVG or color replacements leave the existing visual unchanged.
Parameters 2
| Name | Type | Use | Default |
|---|---|---|---|
id | decimal string | required | — |
patch | table | required | — |
Returns
- boolean
- reason
Example
-- Several changes in one operation
Open77.blips.update(jobBlip, { label = "Drop-off", sprite = "objective", active = true })Custom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipUpdate (line 23006).
waypoint
Open77.blips.waypoint()Where the player's map waypoint is, or nil when there is none.
Reads the vanilla waypoint, the manually tracked mappin, whoever set it: this resource, another resource, or the player right-clicking the fullscreen map. nil with no reason means there is simply no waypoint; nil WITH a reason means the question could not be asked. A GPS script has to tell those apart, because cancelling a fare is correct for only the first. Requires ui.vanilla.map.
Returns
- table { x, y, z }, or nil when no waypoint is set
- reason (only on failure): permission_denied:ui.vanilla.map, waypoint_unavailable_on_this_host, native_unavailable, wrong_thread, world_unavailable
Example
-- The taxi drives to wherever the customer put their map waypoint
local to = Open77.blips.waypoint()
if to then
TriggerServerEvent("taxi:order", to)
else
Open77.hud.notify("Set a waypoint on the map first")
endCustom SVG blips & colors · Registered in ResourceHost.cpp as LuaBlipWaypoint (line 25479).
// For agents & LLMsthis page as Markdownllms.txtllms-full.txt
