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:newCallomik_callist:NewCallomik_callist:addCallomik_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+)
| Field | Description | Type | Required |
|---|---|---|---|
| src | Sender source ID. If omitted, it is auto-filled from event source when possible | number | No |
| identifier | Identifier used to resolve sender phone (alternative to src) | string | number | No |
| from | Explicit sender label shown in call list (e.g. Dispatch, CAD) | string | No |
| message | Message content | string | Yes |
| service | One of the jobs in Config.jobs | string | Yes |
| coords | Coordinates for the call | {x:number,y:number} or vector2(x, y) | Yes |
Legacy parameters (still supported)
| Parameter | Description | Type | Default |
|---|---|---|---|
| playerSrc | Sender's source ID or 0 for unknown sender | number | 0 |
| message | Message to be sent | string | "" |
| job | One of the jobs in Config.jobs | string | "" |
| coords | Vector with x,y coords | vector2(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)