API Reference
Public exports and events for UI Marker v1 integration
Client Exports
Client-side functions for local marker rendering and interactions.
| Export | Parameters | Returns | Description |
|---|---|---|---|
addMarker(data) | data: table | string | Adds a new marker. Returns marker ID |
removeMarker(id) | id: string | boolean | Removes a marker by ID |
showZone(data) | data: table | string | Shows a UI zone. Returns zone ID |
hideZone(id) | id: string | boolean | Hides a UI zone by ID |
updateMarker(id, data) | id: string, data: table | boolean | Updates an existing marker |
Server Exports
Server-side functions for synchronized markers and zones.
| Export | Parameters | Returns | Description |
|---|---|---|---|
createGlobalMarker(data) | data: table | string | Creates a marker visible to all players |
removeGlobalMarker(id) | id: string | boolean | Removes a global marker |
createPlayerMarker(playerId, data) | playerId: number, data: table | string | Creates a marker for a specific player |
removePlayerMarker(playerId, id) | playerId: number, id: string | boolean | Removes a player-specific marker |
System Overview
UI Marker provides a flexible marker and zone system for FiveM.
- Client: Handles local marker rendering and player interactions
- Server: Manages synchronized markers visible to multiple players
- Types: Supports cylinders, arrows, zones, and blips
Marker Types
cylinder: 3D cylindrical markers for areasarrow: Directional arrow markers for navigationzone: Interactive zones with enter/exit detectionblip: Map blips for navigation
For detailed integration examples, see the Client Integration and Server Integration pages.
Parameter Details
addMarker / showZone
data: table with the following fields:type:string— Marker type (e.g. 'cylinder', 'arrow', 'zone')coords:vector3— World coordinatescolor:table—{ r, g, b, a }(0-255)size:table—{ x, y, z }(marker size)label:string— Display label (optional)onEnter:function— Callback when player enters (optional)onExit:function— Callback when player exits (optional)meta:table— Any additional metadata (optional)
removeMarker / hideZone
id: Marker or zone ID (string)
Example Data Structure
{
type = 'cylinder',
coords = vector3(200.0, 300.0, 40.0),
color = { r = 0, g = 255, b = 0, a = 128 },
size = { x = 2.0, y = 2.0, z = 1.0 },
label = 'Shop Entrance',
onEnter = function() print('Entered zone!') end,
onExit = function() print('Exited zone!') end,
meta = { shopId = 1 }
}Events
| Event | Parameters | Description |
|---|---|---|
uimarker:client:markerEntered | id: string, meta: table | Fired when a player enters a marker |
uimarker:client:markerExited | id: string, meta: table | Fired when a player exits a marker |
uimarker:client:zoneShown | id: string, meta: table | Fired when a UI zone is shown |
uimarker:client:zoneHidden | id: string, meta: table | Fired when a UI zone is hidden |
Example Usage
-- Add a marker
local markerId = exports['uimarker']:addMarker({
type = 'cylinder',
coords = vector3(200.0, 300.0, 40.0),
color = { r = 0, g = 255, b = 0, a = 128 },
size = { x = 2.0, y = 2.0, z = 1.0 },
label = 'Shop Entrance',
onEnter = function() print('Entered zone!') end,
onExit = function() print('Exited zone!') end,
meta = { shopId = 1 }
})
-- Listen for marker entry
RegisterNetEvent('uimarker:client:markerEntered', function(id, meta)
print('Marker entered:', id, meta)
end)For advanced use cases, contact the development team for guidance on safe integration.
UI Marker Overview
UI Marker is a modular, closed-source marker and zone display framework for FiveM. It provides public APIs and event hooks for creating, showing, and managing world markers and UI zones, while keeping internal logic secure.
Client Integration
Client-side exports and events for UI Marker v1