NightZoom LogoNightZoom

API Reference

Public exports and events for UI Marker v1 integration

Client Exports

Client-side functions for local marker rendering and interactions.

ExportParametersReturnsDescription
addMarker(data)data: tablestringAdds a new marker. Returns marker ID
removeMarker(id)id: stringbooleanRemoves a marker by ID
showZone(data)data: tablestringShows a UI zone. Returns zone ID
hideZone(id)id: stringbooleanHides a UI zone by ID
updateMarker(id, data)id: string, data: tablebooleanUpdates an existing marker

Server Exports

Server-side functions for synchronized markers and zones.

ExportParametersReturnsDescription
createGlobalMarker(data)data: tablestringCreates a marker visible to all players
removeGlobalMarker(id)id: stringbooleanRemoves a global marker
createPlayerMarker(playerId, data)playerId: number, data: tablestringCreates a marker for a specific player
removePlayerMarker(playerId, id)playerId: number, id: stringbooleanRemoves 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 areas
  • arrow: Directional arrow markers for navigation
  • zone: Interactive zones with enter/exit detection
  • blip: 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 coordinates
    • color: 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

EventParametersDescription
uimarker:client:markerEnteredid: string, meta: tableFired when a player enters a marker
uimarker:client:markerExitedid: string, meta: tableFired when a player exits a marker
uimarker:client:zoneShownid: string, meta: tableFired when a UI zone is shown
uimarker:client:zoneHiddenid: string, meta: tableFired 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.