🤠 Wild Country Libs
Client API

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().

CreateBlip(x, y, z, label?)client

Creates a labelled map blip at the given world position.

ParamTypeDescription
x, y, znumberWorld coordinates for the blip.
labelstring | nilMap label. Defaults to "Encounter".
ReturnsType
blipnumber | nil — raw blip handle, or nil on failure
example
local blip = wc:CreateBlip(pos.x, pos.y, pos.z, "Stranded Traveler")
-- later —
wc:RemoveBlip(blip)
RemoveBlip(blip)client

Removes a blip if it still exists. Safe to call with a stale or nil handle.

ParamTypeDescription
blipnumber | nilBlip handle returned by CreateBlip or CreateEntityBlip.
CreateEntityBlip(entity, label?)client

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.

ParamTypeDescription
entitynumberEntity handle to track. Returns nil if it doesn't exist.
labelstring | nilMap label. Defaults to "Encounter".
ReturnsType
blipnumber | nil — raw blip handle
example — track a wanted outlaw on horseback
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
How it cleans up. The internal tracking thread checks 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:

wc_stagecoach/client/main.lua
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

Troubleshooting