🤠 Wild Country Libs
Client API

Ground Markers

A thin wrapper around RedM's DrawMarker native (0x2A32FAA57B937173). Spawns a ground disc that draws every frame in its own thread and can be removed with a single method call.

CreateMarker(x, y, z, opts?)client

Draws a ground marker at the given world position. Returns a handle with a Remove() method to stop drawing.

ParamTypeDescription
x, y, znumberWorld position of the marker centre.
opts.typenumber | nilMarker type hash. Default 0x94FDAE17 (flat disc).
opts.scaleX / scaleYnumber | nilHorizontal scale in metres. Default 1.0.
opts.scaleZnumber | nilVertical scale. Default 0.1.
opts.r / g / bnumber | nilRGB colour 0–255. Default white (255, 255, 255).
opts.anumber | nilAlpha 0–255. Default 150.
opts.drawRadiusnumber | nilIf set, the marker only draws when the player is within this distance (metres). Omit for always-visible.
ReturnsDescription
handleTable with a single handle:Remove() method. Call it to stop the draw thread.
example — yellow zone marker with draw distance
local marker = wc:CreateMarker(pos.x, pos.y, pos.z, {
  scaleX      = 2.0,
  r           = 255,
  g           = 220,
  b           = 0,
  a           = 180,
  drawRadius  = 25.0,
})

-- when the encounter ends —
marker:Remove()
example — minimal default (white disc, always visible)
local marker = wc:CreateMarker(x, y, z)
-- remove later
marker:Remove()
RedM native note. The standard DrawMarker global does not exist in RedM. CreateMarker calls the underlying native directly via Citizen.InvokeNative(0x2A32FAA57B937173, ...) every frame. This is handled transparently — you never need to manage the draw loop yourself.
Cleanup. The draw thread exits as soon as handle:Remove() is called. No blip or GPS is attached — if you need a map blip at the same location, create one separately with wc:CreateBlip.

Real Wild County example — trader stall drop-off zone

wc_trader/client/main.lua
local dropZone = wc:CreateMarker(stall.x, stall.y, stall.z, {
  scaleX = 1.5, r = 80, g = 200, b = 120, a = 160,
  drawRadius = 20.0,
})

-- when the player leaves the trader's radius or the resource stops:
dropZone:Remove()

Common mistakes

Troubleshooting