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.
| Param | Type | Description |
|---|---|---|
| x, y, z | number | World position of the marker centre. |
| opts.type | number | nil | Marker type hash. Default 0x94FDAE17 (flat disc). |
| opts.scaleX / scaleY | number | nil | Horizontal scale in metres. Default 1.0. |
| opts.scaleZ | number | nil | Vertical scale. Default 0.1. |
| opts.r / g / b | number | nil | RGB colour 0–255. Default white (255, 255, 255). |
| opts.a | number | nil | Alpha 0–255. Default 150. |
| opts.drawRadius | number | nil | If set, the marker only draws when the player is within this distance (metres). Omit for always-visible. |
| Returns | Description |
|---|---|
| handle | Table 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
- Never storing the returned handle — without it you have no way to call
Remove()later, and the draw thread runs forever. - Creating dozens of always-visible markers (no
drawRadius) across a large map — setdrawRadiusso distant markers skip their per-frame native call. - Forgetting this is visual only — a marker draws a disc but does not detect when the player enters it. Pair it with
IsPlayerNearCoordsorWatchPlayerNearfor actual proximity logic.
Troubleshooting
- If the marker never appears: double-check the world coordinates — a marker below the terrain (wrong Z) draws but is invisible.
- If markers linger after your resource restarts: call
Remove()in your cleanup path, or wire the handle into a cleanup bag viaAddCustom.