Server Exports
The call list has a few exports that make it easy to communicate with the call list. See the available server exports below.
Adding a New Call
Export: newCall
Send a new call to the call list
Aliases
The following export names all perform the same action:
newCall
NewCall
addCall
AddCall
exports["omik_callist"]:newCall(playerSrc, message, job, coords)
Parameters
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) |
Example
Server-side Example
local player = source
local ped = GetPlayerPed(player)
local playerCoords = GetEntityCoords(ped)
exports["omik_callist"]:newCall(source, "I need help", "police", playerCoords.xy)
Using an Alias
-- You can use any of the aliases the same way
local player = source
local playerCoords = GetEntityCoords(GetPlayerPed(player))
exports["omik_callist"]:addCall(source, "Medical assistance needed", "ambulance", playerCoords.xy)
Getting Configuration
Export: Config
Get the configuration settings for the call list
exports["omik_callist"]:Config()
Example
local config = exports["omik_callist"]:Config()
print("Available jobs: " .. json.encode(config.jobs))