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.
lua
--- @return table data A table containing the player’s data.
--- @example
--- local data = exports['cd_dispatch']:GetPlayerInfo()
---
--- print(json.encode(data))Example Output
lua
{
heading = "West Bound",
speed = 0.0,
coords = vec3(436.384003, -1018.631042, 28.369473),
vehicle_colour = "black",
ped = 13314,
street_2 = "Mission Row",
vehicle_plate = "44WSX569",
street = "Vespucci Blvd, Mission Row",
sex = "person",
street_1 = "Vespucci Blvd",
vehicle_label = "Adder",
vehicle = 799490,
}lua
local data = exports['cd_dispatch3d']:GetPlayerInfo()Get All Dispatch Notifications
Returns all active dispatch notifications.
lua
--- @return table notifications A table containing all current dispatch notifications.
--- @example
--- local notifications = exports['cd_dispatch']:GetAllDispatchNotifications()
--- print(json.encode(notifications))Example Output
lua
{
['KHSC-D1S9-58FS-27TT'] = {
flash = false,
title = "Law Enforcement Ping",
epoch = 1785180647,
job_table = {
[1] = "police",
[2] = "ambulance",
},
coords = {
x = 434.09353637695,
y = -1019.5675048828,
z = 28.400123596191,
},
radius_blip = 17432632,
message = "[NO CALLSIGN] ramp clash has sent you a ping to their location at Vespucci Blvd, Mission Row",
distance = 0,
responding_state = false,
unique_id = "KHSC-D1S9-58FS-27TT",
blip = 17367095,
responding = 0,
},
}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).
lua
--- @return table playerData A table containing the player’s dispatch data.
--- @example
--- local playerData = exports['cd_dispatch']:GetPlayersDispatchData()
---
--- print(json.encode(playerData))Example Output
lua
{
ui_display_keys = {
smalluileft = "Arrow Left",
smalluiright = "Arrow Right",
responding = "G",
},
planner_perms = false,
callsign = "NO CALLSIGN",
dispatcher_perms = false,
source = 1,
char_name = "ramp clash",
}lua
local playerData = exports['cd_dispatch']:GetPlayersDispatchData()Get Config
Returns all configuration data from the dispatch’s config.lua file.
lua
--- @return table configData A table containing the dispatch configuration.
--- @example
--- local config = exports['cd_dispatch']:GetConfig()
--- print(json.encode(config))Example Output
lua
{
Ping = {
key = "",
ENABLE = true,
command = "dispatchping",
cooldown = 10,
},
DispatchCallExpiryTime = 60,
EnableTestCommand = true,
JobCallCommands = {
Civilian_Commands = {
[1] = {
job_label = "Police",
command = "911",
job_table = {
[1] = "police",
},
},
[2] = {
job_label = "Ambulance",
command = "911ems",
job_table = {
[1] = "ambulance",
},
},
[3] = {
job_label = "Mechanic",
command = "mechanic",
job_table = {
[1] = "mechanic",
},
},
},
ENABLE = true,
JobReply_Command = "reply",
},
AutoUpdatePlayerCoordinates = {
time = 5,
ENABLE = true,
},
large_ui = {
ENABLE = true,
command = "dispatchlarge",
key = "l",
},
FollowPlayer = {
time = 500,
ENABLE = true,
},
Perms = {
Planner = {
police = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
},
Dispatcher = {
mechanic = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
ambulance = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
police = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
fire = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
sheriff = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
},
},
small_ui_left = {
ENABLE = true,
command = "scrollleft",
key = "left",
},
PauseMenuBlips = {
minimize_longdistance_blips = true,
blip_sprites = {
car = 56,
static = 1,
helicopter = 43,
motorcycle = 226,
boat = 427,
foot = 1,
},
blip_type = "auto",
bundle_blips = false,
radiochannel_on_blips = true,
flashing_blips = true,
blip_colours = {
mechanic = {
[1] = 2,
[2] = 0,
},
ambulance = {
[1] = 1,
[2] = 0,
},
police = {
[1] = 3,
[2] = 1,
},
fire = {
[1] = 1,
[2] = 0,
},
sheriff = {
[1] = 3,
[2] = 1,
},
},
data_update_timer = 3,
ENABLE = true,
},
AfkTimer = {
time = 5,
ENABLE = true,
},
PoliceAlerts = {
MeleeFight = {
random_chance = 75,
ENABLE = true,
cooldown = 30,
},
police_jobs = {
[1] = "police",
},
VehicleAlarm = {
random_chance = 50,
ENABLE = true,
cooldown = 30,
},
Explosion = {
random_chance = 75,
WhitelistedZones = {
[1] = {
coords = "vec3(0.000000, 0.000000, 0.000000)",
radius = 20,
},
},
max_distance_from_player = 200.0,
cooldown = 30,
ENABLE = true,
},
WeaponDrawn = {
random_chance = 50,
ENABLE = true,
WhitelistedWeapons = {
[1] = -1569615261,
[2] = -1951375401,
[3] = 101631238,
[4] = 883325847,
[5] = -1168940174,
[6] = 911657153,
[7] = 1233104067,
[8] = 1198879012,
[9] = 1737195953,
[10] = -1810795771,
[11] = 1141786504,
},
cooldown = 30,
},
VehicleAssault = {
cooldown = 30,
ENABLE = true,
random_chance = 75,
min_speed_mph = 20,
},
GunShots = {
random_chance = 75,
WhitelistedWeapons = {
[1] = 1233104067,
[2] = 1198879012,
[3] = 101631238,
[4] = 883325847,
[5] = 911657153,
[6] = -1466123874,
[7] = 126349499,
[8] = -135142818,
},
cooldown = 30,
BurstShots = {
min_shots_in_burst = 3,
burst_gap_ms = 700,
burst_settle_ms = 2000,
},
WhitelistedZones = {
[1] = {
coords = "vec3(13.980000, -1098.050049, 29.799999)",
radius = 20,
},
[2] = {
coords = "vec3(821.090027, -2163.459961, 78.669998)",
radius = 20,
},
},
ENABLE = true,
},
CarJacking = {
random_chance = 75,
ENABLE = true,
cooldown = 30,
},
ENABLE = true,
add_bolos = true,
RecklessDriving = {
min_speed = 30,
ENABLE = true,
random_chance = 75,
cooldown = 30,
},
whitelisted_jobs = {
[1] = "police",
},
CarCrash = {
cooldown = 30,
ENABLE = true,
random_chance = 75,
minimum_crash_speed = 50,
},
GunPointCarJacking = {
random_chance = 100,
ENABLE = true,
max_distance = 20,
cooldown = 45,
},
WitnessPeds = {
NoSnitchingZones = {
[1] = {
coords = "vec3(30.010000, -1847.599976, 24.510000)",
radius = 150,
},
[2] = {
coords = "vec3(-187.220001, -1627.699951, 33.610001)",
radius = 100,
},
[3] = {
coords = "vec3(333.380005, -2037.739990, 21.070000)",
radius = 80,
},
},
ENABLE = true,
radius = 50,
BlacklistedPedModels = {
[1] = 999748158,
},
time_to_kill_caller = 10,
max_callers = 1,
},
SpeedTrap = {
ENABLE = true,
enable_blip = true,
cooldown = 30,
check_owner_for_fine = true,
speed_unit = "mph",
Locations = {
[1] = {
coords = "vec3(1051.420044, 331.109985, 84.000000)",
speed_limit = 150,
fine_amount = 500,
radius = 9,
},
[2] = {
coords = "vec3(544.429993, -373.239990, 33.139999)",
speed_limit = 150,
fine_amount = 5000,
radius = 9,
},
[3] = {
coords = "vec3(-2612.100098, 2940.810059, 16.670000)",
speed_limit = 150,
fine_amount = 1000,
radius = 15,
},
[4] = {
coords = "vec3(287.940002, -517.440002, 42.889999)",
speed_limit = 100,
fine_amount = 500,
radius = 15,
},
[5] = {
coords = "vec3(2792.729980, 4407.680176, 48.439999)",
speed_limit = 150,
fine_amount = 1000,
radius = 24,
},
[6] = {
coords = "vec3(577.109985, -1028.319946, 37.070000)",
speed_limit = 100,
fine_amount = 1000,
radius = 15,
},
[7] = {
coords = "vec3(114.830002, -797.890015, 30.969999)",
speed_limit = 100,
fine_amount = 2000,
radius = 15,
},
[8] = {
coords = "vec3(74.330002, -163.300003, 54.669998)",
speed_limit = 100,
fine_amount = 4000,
radius = 15,
},
[9] = {
coords = "vec3(28.190001, -971.049988, 28.959999)",
speed_limit = 100,
fine_amount = 1000,
radius = 15,
},
},
Society = {
job = "police",
ENABLE = true,
},
},
},
UpdateDistanceToCall = {
time = 2,
ENABLE = true,
},
small_ui = {
ENABLE = true,
command = "dispatchsmall",
key = "u",
},
PanicButton = {
ENABLE = true,
command = "panic",
cooldown = 10,
key = "",
job_table = {
[1] = "police",
[2] = "ambulance",
},
play_sound_in_distance = true,
},
respond = {
ENABLE = true,
command = "respond",
key = "g",
},
AntiCheat = {
ENABLE = true,
AllowedJobsOnly = {
ENABLE = true,
},
EventSpam = {
fast = {
events = 5,
time = 3,
},
ENABLE = true,
slow = {
events = 5,
time = 20,
},
},
discord_tag_everyone = true,
BannedWords = {
banned_words = {
[1] = "http",
[2] = "discord",
[3] = ".gg",
[4] = "fuck",
[5] = "fucker",
[6] = "fucking",
[7] = "shit",
[8] = "shitty",
[9] = "bullshit",
[10] = "cunt",
[11] = "bitch",
[12] = "bastard",
[13] = "asshole",
[14] = "arsehole",
[15] = "motherfucker",
[16] = "whore",
[17] = "slut",
[18] = "hoe",
[19] = "skank",
[20] = "retard",
[21] = "prick",
[22] = "twat",
[23] = "wanker",
[24] = "dipshit",
[25] = "shithead",
[26] = "fuckhead",
[27] = "asshat",
[28] = "fuk",
[29] = "fck",
[30] = "fuq",
[31] = "sh1t",
[32] = "b1tch",
[33] = "c*nt",
[34] = "f*ck",
[35] = "biatch",
[36] = "azzhole",
[37] = "a$$hole",
},
ENABLE = true,
},
DuplicateMessages = {
threshold = {
events = 3,
time = 10,
},
ENABLE = true,
},
},
NotifyStatusChange = true,
AutoInsertSQL = true,
AllowedJobs = {
[1] = {
[1] = "police",
[2] = "ambulance",
},
[2] = {
[1] = "mechanic",
},
},
Dispatcher = {
ENABLE = true,
notify_activity = true,
VoipResource = "toko",
},
GpsTracker = {
item_name = "CHANGE_ME",
ENABLE = false,
item_check_timer = 10,
AllowedJobs = {
[1] = "police",
[2] = "ambulance",
},
},
WaypointTracking = {
auto_cancel_distance = 30,
update_timer = 1,
},
Debug = true,
HeatMap = {
limit_calls = 100,
ENABLE = true,
},
small_ui_right = {
ENABLE = true,
command = "scrollright",
key = "right",
},
}lua
local config = exports['cd_dispatch']:GetConfig()Server
Get All Dispatch Notifications
Returns all active dispatch notifications.
lua
--- @return table notifications A table containing all current dispatch notifications.
--- @example
--- local notifications = exports['cd_dispatch']:GetAllDispatchNotifications()
--- print(json.encode(notifications))Example Output
lua
{
[1] = {
flash = true,
title = "911 - PANIC BUTTON",
epoch = 1785179511,
job_table = {
[1] = "police",
[2] = "ambulance",
},
responding = 0,
sound = 4,
message = "[NO CALLSIGN] ramp clash needs urgent assistance at Vespucci Blvd, Mission Row",
coords = {
x = 436.37091064453,
y = -1018.6312866211,
z = 28.798891067505,
},
blip = {
time = 5,
text = "911 - PANIC BUTTON",
radius = 0,
scale = 1.5,
colour = 3,
sprite = 58,
flashes = true,
},
unique_id = "EXEQ-GN8A-PWGJ-7JP1",
},
}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.
lua
--- @param source number The player’s server ID.
--- @return table playerData A table containing the player’s dispatch data.
--- @example
--- local source= source
--- local playerData = exports['cd_dispatch']:GetPlayersDispatchData(source)
--- print(json.encode(playerData))Example Output
lua
{
on_duty = true,
status = {
name = "Available",
color = "#539D1B",
},
vehicle = "foot",
radio_channel = 0,
callsign = "NO CALLSIGN",
source = 1,
coords = {
h = 99.21,
y = -1018.64,
z = 28.79,
x = 436.36,
},
job = "police",
char_name = "ramp clash",
}lua
local playerData = exports['cd_dispatch']:GetPlayersDispatchData(source)Get Config
Returns all configuration data from the dispatch’s config.lua file.
lua
--- @return table configData A table containing the dispatch configuration.
--- @example
--- local config = exports['cd_dispatch']:GetConfig()
--- print(json.encode(config))Example Output
lua
{
Ping = {
key = "",
ENABLE = true,
command = "dispatchping",
cooldown = 10,
},
DispatchCallExpiryTime = 60,
EnableTestCommand = true,
JobCallCommands = {
Civilian_Commands = {
[1] = {
job_label = "Police",
command = "911",
job_table = {
[1] = "police",
},
},
[2] = {
job_label = "Ambulance",
command = "911ems",
job_table = {
[1] = "ambulance",
},
},
[3] = {
job_label = "Mechanic",
command = "mechanic",
job_table = {
[1] = "mechanic",
},
},
},
ENABLE = true,
JobReply_Command = "reply",
},
AutoUpdatePlayerCoordinates = {
time = 5,
ENABLE = true,
},
large_ui = {
ENABLE = true,
command = "dispatchlarge",
key = "l",
},
FollowPlayer = {
time = 500,
ENABLE = true,
},
Perms = {
Planner = {
police = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
},
Dispatcher = {
mechanic = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
ambulance = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
police = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
fire = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
sheriff = {
[1] = 0,
[2] = 1,
[3] = 2,
[4] = 3,
},
},
},
small_ui_left = {
ENABLE = true,
command = "scrollleft",
key = "left",
},
PauseMenuBlips = {
minimize_longdistance_blips = true,
blip_sprites = {
car = 56,
static = 1,
helicopter = 43,
motorcycle = 226,
boat = 427,
foot = 1,
},
blip_type = "auto",
bundle_blips = false,
radiochannel_on_blips = true,
flashing_blips = true,
blip_colours = {
mechanic = {
[1] = 2,
[2] = 0,
},
ambulance = {
[1] = 1,
[2] = 0,
},
police = {
[1] = 3,
[2] = 1,
},
fire = {
[1] = 1,
[2] = 0,
},
sheriff = {
[1] = 3,
[2] = 1,
},
},
data_update_timer = 3,
ENABLE = true,
},
AfkTimer = {
time = 5,
ENABLE = true,
},
PoliceAlerts = {
MeleeFight = {
random_chance = 75,
ENABLE = true,
cooldown = 30,
},
police_jobs = {
[1] = "police",
},
VehicleAlarm = {
random_chance = 50,
ENABLE = true,
cooldown = 30,
},
Explosion = {
random_chance = 75,
WhitelistedZones = {
[1] = {
coords = "vec3(0.000000, 0.000000, 0.000000)",
radius = 20,
},
},
max_distance_from_player = 200.0,
cooldown = 30,
ENABLE = true,
},
WeaponDrawn = {
random_chance = 50,
ENABLE = true,
WhitelistedWeapons = {
[1] = -1569615261,
[2] = -1951375401,
[3] = 101631238,
[4] = 883325847,
[5] = -1168940174,
[6] = 911657153,
[7] = 1233104067,
[8] = 1198879012,
[9] = 1737195953,
[10] = -1810795771,
[11] = 1141786504,
},
cooldown = 30,
},
VehicleAssault = {
cooldown = 30,
ENABLE = true,
random_chance = 75,
min_speed_mph = 20,
},
GunShots = {
random_chance = 75,
WhitelistedWeapons = {
[1] = 1233104067,
[2] = 1198879012,
[3] = 101631238,
[4] = 883325847,
[5] = 911657153,
[6] = -1466123874,
[7] = 126349499,
[8] = -135142818,
},
cooldown = 30,
BurstShots = {
min_shots_in_burst = 3,
burst_gap_ms = 700,
burst_settle_ms = 2000,
},
WhitelistedZones = {
[1] = {
coords = "vec3(13.980000, -1098.050049, 29.799999)",
radius = 20,
},
[2] = {
coords = "vec3(821.090027, -2163.459961, 78.669998)",
radius = 20,
},
},
ENABLE = true,
},
CarJacking = {
random_chance = 75,
ENABLE = true,
cooldown = 30,
},
ENABLE = true,
add_bolos = true,
RecklessDriving = {
min_speed = 30,
ENABLE = true,
random_chance = 75,
cooldown = 30,
},
whitelisted_jobs = {
[1] = "police",
},
CarCrash = {
cooldown = 30,
ENABLE = true,
random_chance = 75,
minimum_crash_speed = 50,
},
GunPointCarJacking = {
random_chance = 100,
ENABLE = true,
max_distance = 20,
cooldown = 45,
},
WitnessPeds = {
NoSnitchingZones = {
[1] = {
coords = "vec3(30.010000, -1847.599976, 24.510000)",
radius = 150,
},
[2] = {
coords = "vec3(-187.220001, -1627.699951, 33.610001)",
radius = 100,
},
[3] = {
coords = "vec3(333.380005, -2037.739990, 21.070000)",
radius = 80,
},
},
ENABLE = true,
radius = 50,
BlacklistedPedModels = {
[1] = 999748158,
},
time_to_kill_caller = 10,
max_callers = 1,
},
SpeedTrap = {
ENABLE = true,
enable_blip = true,
cooldown = 30,
check_owner_for_fine = true,
speed_unit = "mph",
Locations = {
[1] = {
coords = "vec3(1051.420044, 331.109985, 84.000000)",
speed_limit = 150,
fine_amount = 500,
radius = 9,
},
[2] = {
coords = "vec3(544.429993, -373.239990, 33.139999)",
speed_limit = 150,
fine_amount = 5000,
radius = 9,
},
[3] = {
coords = "vec3(-2612.100098, 2940.810059, 16.670000)",
speed_limit = 150,
fine_amount = 1000,
radius = 15,
},
[4] = {
coords = "vec3(287.940002, -517.440002, 42.889999)",
speed_limit = 100,
fine_amount = 500,
radius = 15,
},
[5] = {
coords = "vec3(2792.729980, 4407.680176, 48.439999)",
speed_limit = 150,
fine_amount = 1000,
radius = 24,
},
[6] = {
coords = "vec3(577.109985, -1028.319946, 37.070000)",
speed_limit = 100,
fine_amount = 1000,
radius = 15,
},
[7] = {
coords = "vec3(114.830002, -797.890015, 30.969999)",
speed_limit = 100,
fine_amount = 2000,
radius = 15,
},
[8] = {
coords = "vec3(74.330002, -163.300003, 54.669998)",
speed_limit = 100,
fine_amount = 4000,
radius = 15,
},
[9] = {
coords = "vec3(28.190001, -971.049988, 28.959999)",
speed_limit = 100,
fine_amount = 1000,
radius = 15,
},
},
Society = {
job = "police",
ENABLE = true,
},
},
},
UpdateDistanceToCall = {
time = 2,
ENABLE = true,
},
small_ui = {
ENABLE = true,
command = "dispatchsmall",
key = "u",
},
PanicButton = {
ENABLE = true,
command = "panic",
cooldown = 10,
key = "",
job_table = {
[1] = "police",
[2] = "ambulance",
},
play_sound_in_distance = true,
},
respond = {
ENABLE = true,
command = "respond",
key = "g",
},
AntiCheat = {
ENABLE = true,
AllowedJobsOnly = {
ENABLE = true,
},
EventSpam = {
fast = {
events = 5,
time = 3,
},
ENABLE = true,
slow = {
events = 5,
time = 20,
},
},
discord_tag_everyone = true,
BannedWords = {
banned_words = {
[1] = "http",
[2] = "discord",
[3] = ".gg",
[4] = "fuck",
[5] = "fucker",
[6] = "fucking",
[7] = "shit",
[8] = "shitty",
[9] = "bullshit",
[10] = "cunt",
[11] = "bitch",
[12] = "bastard",
[13] = "asshole",
[14] = "arsehole",
[15] = "motherfucker",
[16] = "whore",
[17] = "slut",
[18] = "hoe",
[19] = "skank",
[20] = "retard",
[21] = "prick",
[22] = "twat",
[23] = "wanker",
[24] = "dipshit",
[25] = "shithead",
[26] = "fuckhead",
[27] = "asshat",
[28] = "fuk",
[29] = "fck",
[30] = "fuq",
[31] = "sh1t",
[32] = "b1tch",
[33] = "c*nt",
[34] = "f*ck",
[35] = "biatch",
[36] = "azzhole",
[37] = "a$$hole",
},
ENABLE = true,
},
DuplicateMessages = {
threshold = {
events = 3,
time = 10,
},
ENABLE = true,
},
},
NotifyStatusChange = true,
AutoInsertSQL = true,
AllowedJobs = {
[1] = {
[1] = "police",
[2] = "ambulance",
},
[2] = {
[1] = "mechanic",
},
},
Dispatcher = {
ENABLE = true,
notify_activity = true,
VoipResource = "toko",
},
GpsTracker = {
item_name = "CHANGE_ME",
ENABLE = false,
item_check_timer = 10,
AllowedJobs = {
[1] = "police",
[2] = "ambulance",
},
},
WaypointTracking = {
auto_cancel_distance = 30,
update_timer = 1,
},
Debug = true,
HeatMap = {
limit_calls = 100,
ENABLE = true,
},
small_ui_right = {
ENABLE = true,
command = "scrollright",
key = "right",
},
}lua
local config = exports['cd_dispatch']:GetConfig()