Hop til hovedindhold

Client Exports

The call list has a few exports that make it easy to communicate with the call list from the client side. See the available client exports below.

Adding a New Call

Export: newCall

Send a new call to the call list from a client script

Aliases

The following export names all perform the same action:

  • newCall
  • NewCall
  • addCall
  • AddCall
exports["omik_callist"]:newCall(playerSrc, message, job, coords)

Parameters

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)

Example

Basic Example
local player = GetPlayerServerId(PlayerId())
local playerCoords = GetEntityCoords(PlayerPedId())
exports["omik_callist"]:newCall(player, "I need help", "police", playerCoords.xy)
Using an Alias
-- You can use any of the aliases the same way
local player = GetPlayerServerId(PlayerId())
local playerCoords = GetEntityCoords(PlayerPedId())
exports["omik_callist"]:addCall(player, "Medical assistance needed", "ambulance", playerCoords.xy)

Opening the Call List

Export: open

Open the call list interface from a client script

Aliases

The following export names all perform the same action:

  • open
  • Open

Example

-- To open the call list interface
exports["omik_callist"]:open()

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))