Skip to content

Exports

Note


These exports are entirely optional and can be used as needed within your own scripts or integrations.

Client

Get Player Info

Returns useful information about a player that can be used to create new dispatch notifications.

@parameters
lua
--- @return table data A table containing the players data.
--- @example
--- local data = exports['cd_dispatch']:GetPlayerInfo()
---
--- print(json.encode(data))
lua
local data = exports['cd_dispatch3d']:GetPlayerInfo()

Get All Dispatch Notifications

Returns all active dispatch notifications.

@parameters
lua
--- @return table notifications A table containing all current dispatch notifications.
--- @example
--- local notifications = exports['cd_dispatch']:GetAllDispatchNotifications()

--- print(json.encode(notifications))
lua
local notifications = exports['cd_dispatch']:GetAllDispatchNotifications()

Get Player’s Dispatch Data

Returns a player’s dispatch-related character data (e.g., callsign, character name, and status).

@parameters
lua
--- @return table playerData A table containing the players dispatch data.
--- @example
--- local playerData = exports['cd_dispatch']:GetPlayersDispatchData()
---
--- print(json.encode(playerData))
lua
local playerData = exports['cd_dispatch']:GetPlayersDispatchData()

Get Config

Returns all configuration data from the dispatch’s config.lua file.

@parameters
lua
--- @return table configData A table containing the dispatch configuration.
--- @example
--- local config = exports['cd_dispatch']:GetConfig()

--- print(json.encode(config))
lua
local config = exports['cd_dispatch']:GetConfig()

Server

Get All Dispatch Notifications

Returns all active dispatch notifications.

@parameters
lua
--- @return table notifications A table containing all current dispatch notifications.
--- @example
--- local notifications = exports['cd_dispatch']:GetAllDispatchNotifications()

--- print(json.encode(notifications))
lua
local notifications = exports['cd_dispatch']:GetAllDispatchNotifications()

Get Player’s Dispatch Data

Returns a player’s dispatch character data, such as callsign, character name, and status.

@parameters
lua
--- @param source number The players server ID.
--- @return table playerData A table containing the players dispatch data.
--- @example
--- local source= source
--- local playerData = exports['cd_dispatch']:GetPlayersDispatchData(source)

--- print(json.encode(playerData))
lua
local playerData = exports['cd_dispatch']:GetPlayersDispatchData(source)

Get Config

Returns all configuration data from the dispatch’s config.lua file.

@parameters
lua
--- @return table configData A table containing the dispatch configuration.
--- @example
--- local config = exports['cd_dispatch']:GetConfig()

--- print(json.encode(config))
lua
local config = exports['cd_dispatch']:GetConfig()

Hello!