Blips
Map blip helpers — create labelled blips at static coordinates, track a moving entity, and remove them cleanly. All three return a raw blip handle compatible with wc:CleanupEncounter and CreateCleanupBag().AddBlip().
Creates a labelled map blip at the given world position.
| Param | Type | Description |
|---|---|---|
| x, y, z | number | World coordinates for the blip. |
| label | string | nil | Map label. Defaults to "Encounter". |
| Returns | Type |
|---|---|
| blip | number | nil — raw blip handle, or nil on failure |
local blip = wc:CreateBlip(pos.x, pos.y, pos.z, "Stranded Traveler")
-- later —
wc:RemoveBlip(blip)
Removes a blip if it still exists. Safe to call with a stale or nil handle.
| Param | Type | Description |
|---|---|---|
| blip | number | nil | Blip handle returned by CreateBlip or CreateEntityBlip. |
Creates a blip that follows a moving entity — a ped, horse, or vehicle. The blip is updated every 100 ms and auto-removes itself when the entity is deleted.
| Param | Type | Description |
|---|---|---|
| entity | number | Entity handle to track. Returns nil if it doesn't exist. |
| label | string | nil | Map label. Defaults to "Encounter". |
| Returns | Type |
|---|---|
| blip | number | nil — raw blip handle |
local horse = wc:SpawnHorse(pos.x, pos.y, pos.z)
local outlaw = wc:SpawnPed(hash, pos.x, pos.y, pos.z)
ev.blip = wc:CreateEntityBlip(horse, "Wanted Outlaw")
-- ev.blip is automatically removed when the horse is deleted by CleanupEncounter
DoesEntityExist each tick — once the entity is gone (deleted by CleanupEncounter or otherwise) the blip removes itself with no extra call needed.
Real Wild County example — permanent stagecoach station blip
A permanent job blip is created once on resource start (not per-player-interaction) and never removed for the life of the resource:
CreateThread(function()
for _, station in ipairs(Config.Stations) do
wc:CreateBlip(station.x, station.y, station.z, "Stagecoach Station")
end
end)
A temporary mission blip, by contrast, is created per-mission and torn down with the rest of the mission's cleanup bag — see Flow helpers.
Common mistakes
- Creating a fresh permanent-location blip every time a menu opens instead of once at resource start — this leaks blips fast.
- Forgetting to call
RemoveBlipfor temporary/mission blips when a mission ends, fails, or times out. - Using
CreateEntityBlipon an entity that might get deleted by something else without also removing the returned blip handle from your own bookkeeping.
Troubleshooting
- If
CreateBlipreturns a handle but nothing shows on the map: double-check the coordinates are correct world coords, not relative offsets. - If a tracking blip from
CreateEntityBlipstops moving: the entity it was tracking was deleted — that's expected; the internal thread exits and the blip is removed automatically. - If
CreateEntityBlipreturnsnil: the entity didn't exist at call time — spawn/verify the entity first, then create the tracking blip.