Skip to main content

Server Events

The call list has a few events that make it easy to communicate with the call list. See the available server events below.

Adding a New Call

Event: omik_callist:newCall

Send a new call to the call list.

Aliases

The following event names all perform the same action:

  • omik_callist:newCall
  • omik_callist:NewCall
  • omik_callist:addCall
  • omik_callist:AddCall
TriggerEvent("omik_callist:newCall", {
src = playerSrc, -- optional, auto-filled from source when possible
identifier = "license:abc123", -- optional alternative to src
from = "Dispatch", -- optional custom sender label
message = "I need help",
service = "police",
coords = { x = 441.2, y = -981.9 } or vector2(441.2, -981.9)
})

Payload fields (v2.2.2+)

FieldDescriptionTypeRequired
srcSender source ID. If omitted, it is auto-filled from event source when possiblenumberNo
identifierIdentifier used to resolve sender phone (alternative to src)string | numberNo
fromExplicit sender label shown in call list (e.g. Dispatch, CAD)stringNo
messageMessage contentstringYes
serviceOne of the jobs in Config.jobsstringYes
coordsCoordinates for the call{x:number,y:number} or vector2(x, y)Yes

Legacy parameters (still supported)

ParameterDescriptionTypeDefault
playerSrcSender's source ID or 0 for unknown sendernumber0
messageMessage to be sentstring""
jobOne of the jobs in Config.jobsstring""
coordsVector with x,y coordsvector2(x, y)

Examples

Payload format (recommended)
-- Inside a server side script
local player = source
local ped = GetPlayerPed(player)
local playerCoords = GetEntityCoords(ped)
TriggerEvent("omik_callist:newCall", {
src = source,
message = "I need help",
service = "police",
coords = { x = playerCoords.x, y = playerCoords.y } or playerCoords.xy
})
Legacy positional format
local player = source
local ped = GetPlayerPed(player)
local playerCoords = GetEntityCoords(ped)
TriggerEvent("omik_callist:newCall", source, "I need help", "police", playerCoords.xy)