Dispatch
Step by step installation guide, common issues & solutions, troubleshooting guide, code snippets, common error codes, config previews, locales previews and changelogs; all in 1 easily accessible place
Buy Here

Translate

START HERE

1. Unzip the cd_dispatch.zip folder and place this folder in your servers resource folder.
2. Add the resource to your server start config: ensure cd_dispatch (it must be placed anywhere below your framework resource eg., es_extended, not above). The name of the folder must not be changed or the resource will not function correctly.
3. WARNING do not edit the encrypted files in any way.

INSTALATION GUIDE

Step 1 - Install the SQL

You MUST import the SQL file to your database. This SQL file is located inside theREAD_ME_AFTER_PURCHASING folder, the file is named SQL_main.sql. Watch this video if you are unsure how to do this HeidiSQL / PHPMyAdmin.

Step 2 - Fxmanifest

You may need to make some changes to the fxmanifest.lua, depending on your framework and dependencies. We have made this easier for you by commenting on the lines which you may need to change.

Step 3 - Configure the resource

You MUST read all of the configurable options inside the config.lua and configure them to suit your server's needs. Please read the ”commented out help text” at the end of each line so you can understand what each config option does.
The most important sections are the options under the Framework and Important sections at the top of the config.lua. Everything else is optional.

Step 4 - Integrate into your resources

We need to replace your existing code for police alerts with the code snippet provided below.
PLEASE READ
  • Below we provide you with 2 different methods of triggering notifications; 1 from the client-side and 1 from the server-side. You DON’T need add both code snippets to trigger the same notification.
  • Choose 1 or the other, but we reccomend you use the client-side method as it’s more simple.
Client-side (recommended)
Server-side
NOTES: With this new client-side method you don't need to add any code to the server side (as seen in the old version), this is now done automatically.
EXAMPLE: Here is an example of how to implement the code snippet below into your robbery/criminal resources to replace your old police alerts.
  • Yellow = Remove the old police alerts code.
  • Red = Copy the code snippet below and paste it as a replacement for the old code you removed above^.
1
local data = exports['cd_dispatch']:GetPlayerInfo()
2
TriggerServerEvent('cd_dispatch:AddNotification', {
3
job_table = {'police'},
4
coords = data.coords,
5
title = '10-15 - Store Robbery',
6
message = 'A '..data.sex..' robbing a store at '..data.street,
7
flash = 0,
8
unique_id = tostring(math.random(0000000,9999999)),
9
blip = {
10
sprite = 431,
11
scale = 1.2,
12
colour = 3,
13
flashes = false,
14
text = '911 - Store Robbery',
15
time = (5*60*1000),
16
sound = 1,
17
}
18
})
Copied!
NOTES: We recommend you use the client-side method, but if you NEED to trigger the notification from the server-side, you can use the code snippet below.
1
TriggerClientEvent('cd_dispatch:AddNotification', -1, {
2
job_table = {'police'},
3
coords = vector3(0, 0, 0),
4
title = '10-15 - Store Robbery',
5
message = 'A person robbing a store',
6
flash = 0,
7
unique_id = tostring(math.random(0000000,9999999)),
8
blip = {
9
sprite = 431,
10
scale = 1.2,
11
colour = 3,
12
flashes = false,
13
text = '911 - Store Robbery',
14
time = (5*60*1000),
15
sound = 1,
16
}
17
})
Copied!

What do each of the variables above mean?

  • job_table = Everyone who has this job will receive this notification. You can add multiple jobs to the table.
    • Example: {'police', 'sheriff}
  • coords = You can change the coordinates to a vector3 format only.
    • Example: vector3(0, 0, 0)
  • title = The title of the notification, normally your police 10 codes are used here.
  • message = You can customise the message and add any of the variables. Read here for more info.
  • flash = Set to 1 to make the UI flash, used for panic button calls etc.
  • unique_id = DON’T change this.
  • blip:
    • sprite = The icon for the blip. More can be found here.
    • scale = Size of the blip.
    • colour = Colour of the blip. More can be found here at the bottom.
    • flashes - If set to true the blip will flash on the pause menu/mini-map, used for more important calls.
    • time - The amount of time until the blip fades (default is 5 mins.)
    • sound - The sound when receiving a notification:
      • 1 = x1 sound alert, 2 = x2 sound alert's, 3 = panic button alert sound.
      • You can change the sounds in the configs/client_customise_me/BlipSound.

What data from the export can I use in the title/message?

The export used in the code snippet above will return this table. This can be customised in the client/main/functions.lua.
1
local data = exports['cd_dispatch']:GetPlayerInfo()
2
3
--The export above will return these values for you to display on the UI.
4
data.ped --The players id: eg., 123456789.
5
data.coords --The players coordinates: eg., vector3(1,2,3).
6
data.street_1 --The street name: eg., “Palomino Ave”.
7
data.street_2 --The streets area name: eg., “Legion Square”.
8
data.street --Both the street name & area name: eg., “Palomino Ave, Legion Square”.
9
data.sex --The players ped’s sex; eg., “Male”.
10
11
--If the player is in a vehicle you can use the vehicle data.
12
data.vehicle --The vehicle id: eg., 123456789.
13
data.vehicle_label --The vehicle name: eg., “Audi RS7”.
14
data.vehicle_colour --The vehicles colour: eg., “Blue”.
15
data.vehicle_plate --The vehicles license plate: eg., “ABCD1234”.
16
data.heading --The vehicles direction: eg., “North”.
17
data.speed --The vehicles speed: eg., “70MPH”.
Copied!

OPTIONAL INSTALATION STEPS

Radio Channels

This option will allow players to see which radio channels other players are in. You will of course need to be using some sort of voice radio resource. This event needs to be triggered from your radio resource, specifically when a player (who has access to use the dispatch) joins/leaves/changes a radio channel, and it needs to send the players new radio channel in the first argument.
Example 1
Example 2
From client to server
1
TriggerServerEvent('cd_dispatch:GetRadioChannel', RADIO_CHANNEL_HERE)
Copied!

Optional on/off Duty Method

Do your players always have the same job but you use locals in resources to check if a player is on/off duty? (Most people will not need to use this, it's just optional).
NOTE: This already comes pre-installed and pre-configured if you are using QBCore.
From client to client
From server to client
Boolean means (true or false).
1
TriggerEvent('cd_dispatch:OnDutyChecks', BOOLEAN)
Copied!
Boolean means (true or false).
1
TriggerClientEvent('cd_dispatch:OnDutyChecks', source, BOOLEAN)
Copied!

INFORMATION

Default Keybinds

Please Read Here for more information regarding key-mapping.
Key
Description
U
Toggles the small dispatch UI.
G
Respond to a notification.
Left/Right Arrows
Scroll through the notifications on the small dispatch UI.
L
Opens the large dispatch UI.

Chat commands

All of these chat commands can be renamed and disabled/enabled in the config/code.
Command
Description
/dispatchsmall
Toggles the small dispatch UI.
/dispatchlarge
Opens the large dispatch UI.
/respond
Respond to a notification.
/movemode
Allows you to move the small UI on your screen.
/panic
Press your panic button.
/reply
Reply to job calls such as /911 calls etc.
/dispatchtest
(Test Command) This is a test command which triggers a police notification.

Events

These events are completely optional, you can use them if needed.
Make sure to look in the code to see if any events require data to be sent in the arguments.
Event Name
Description
TriggerEvent('cd_dispatch:PanicButtonEvent')
Activates the panic button.

SCRIPT NOT WORKING?

Common Issues

🔔 Folder Name Make sure the name of the folder is cd_dispatch.
SQL Default Value Error If you see an error similar to this example when inserting an SQL query into your database - “BLOB/TEXT column 'callsign' can't have a default value”.
✔️ You can use “VARCHAR(256)” instead of “LONGTEXT” in the SQL query.
SQL Unknown Column Error If you see an SQL error in the server console similar to this example - ER_BAD_FIELD_ERROR: Unknown colum 'callsign' in 'where clause'.
✔️ You are missing one of the required database columns. The SQL file can be found in the "READ_ME_AFTER_PURCHASING" folder.
Script Loading If you see this notification at least 10-20 seconds after loading in or restarting the script - “The resource is still loading. Please try again in a few seconds”.
✔️ There will usually be a server side error which will be pretty self explanatory, usually a database error or because your Config.FrameworkTriggers were not configured correctly.

Common Error Codes

Server
Client
N/A
3777 - You have not updated your notifications to use the new method.
3651 - This error code can be ignored, it does not effect anything, it's just trying to delete a notification that has just been deleted.

Troubleshooting

1. Check if the script has authorized correctly. Check the server console to make sure there are no errors saying You lack the required entitlement? and check for 2 client-sided prints saying Loaded Successfully!.
2. Check for obvious error prints in the server console and the client F8 console. If you don't see any obvious errors make sure to restart the script while the server is live and check again.
3. Enable the test command in the config, restart the script and see if it works. If it works it means you have not installed/configured it correctly.
4. Change the key in the config.lua to one that you know works, as one of your other resources, may be disabling that specific key.
5. If none of the above worked, have a second read through the installation guide above, you may have missed something - you are only human.
If all else fails, contact the Codesign Team in the Codesign Discord.

CHANGELOG

Files Changed: Not every update requires you to replace the whole folder. We do this because we understand it's a pain to redo the configs for every update.
  • All Files - This means you should delete your old cd_dispatch folder, download and add in the latest version, reconfigure the configs folder and restart your server.
  • Specific Files - This means you can simply copy and paste the SPECIFIC new files over the old ones and restart the server.
Update Type: On rare occasions, you are forced to update to the latest version. Mostly due to authentication updates where the old versions will no longer work.
  • Mandatory - This means you MUST update to this new version or the old versions will no longer work.
  • Optional - This means its completely your choice whether you wish to update to the latest version. But we do not offer support for old versions for obvious reasons; they are old.
v3.0.0
v409 beta
v410 beta
v411 beta
v4.2.0
v4.2.1

26/12/2020 - 08/11/2021

v3.0.0 - v3.0.5
Files Changed:
  • All files
  • Specific Files
Update Type:
  • Mandatory
  • Optional
Changelog:
Add
  • Added locales for the /911 etc chat commands.
  • Added the ability to rename all esx events such as the setjob and playerloaded events.
Edit
  • Minor script cleanups.
  • Updated the codesign error handlers.
  • Removed the need to cache individual players data when going on/off duty.
  • Added compatibility for oxmysql.
Fix
  • Fixed random server error on server start.
  • Minor bug fixes.
  • Fixed errors with the /callsign command.
  • Fixed error when using the UI before the script has loaded fully.
  • Fixed random server error on server start.
  • Temporary fix for the canary issue until the new Tebex FiveM license system is ready to launch, when this is released we will be fully switching over to the new system.
  • Fixed the random client side error that happens sometimes when pressing G to respond.

20/12/2021

Files Changed:
  • All files
  • Specific Files
Update Type:
  • Mandatory
  • Optional
Changelog:
Authentication
  • We are now using the official Authentication System provided by FiveM. The old auth system will be taken offline 1 week from now (give or take a few days if needed).
Add
  • Large map zoom On the large UI map you can now zoom in and out and move around with the mouse. The blips of calls and other officers will always stay in the exact same position.
  • Grouped units On the large UI, if 2(or more) officers are patrolling together, they can create a group, which will show the other officers that they are patrolling together.
  • Vehicle type status The vehicle type icon on the large UI units list will change depending on what vehicle type a player has set in the settings.
  • Player status The players status on the large UI units list will be visible when you right click a players name on the unit list. Also, the background of the radio channel is also a quick way of viewing a players status as it will change colour when a player changes their status. You can configure add/remove/change statuses in the config, along with configuring the colour of each status.
  • Multi job compatibility You can configure it so multiple jobs can see each other on the large UI and pause menu blips menu. So for example if you have 2 police jobs (police and sheriff) or (police and ambulance), they will now be able to see each other on the maps.
  • Quick join/leave radio channels On the large UI, you can right click a players name on the units list and you have the option to join their radio channel or leave your radio channel.
  • New dispatcher mode When a call is initially received, only the dispatcher can see the call. Dispatchers can enable voice mode while the large UI is enabled to communicate over radio to other officers to see who is available to take calls (the large ui can stay enabled the whole time and everything will be instantly updated on the ui), dispatchers then can drag-and-drop a unit (single unit or grouped unit) onto the call and only that unit will receive the call. If there is no dispatcher logged in, the dispatch will function exactly like it currently does now in previous versions, where all online officers will receive the calls.
  • Pause menu player blips We have added a built in player blips system, which works on OneSync (legacy+infinity)/non OneSync . Your blip icon will change depending on what you have set your vehicle type to on the large UI settings. When your vehicles emergency lights are on your player blip will flash (flashing colours are configurable for each job). Your current radio channel will also be displayed on your player blip. Everything is fully synced across all players.
  • Gunshot, stolen car, speed trap alerts We have added a built in gunshot, stolen car and speed trap alerts, this is all fully configurable in the config.
  • View responding units On the large UI, you will be able to click on a notification and see which units are responding, it will show their name, callsign, how long ago they clicked respond etc.
  • Set GPS location On the large UI, you can right click a players name on the units list and it will set a waypoint to this players location on the pause menu/mini-map.
  • Live Map Added the ability to enable the player blips on the large UI to auto refresh while the UI is open.
  • Multi job notifications When creating notifications from other scripts, instead of only being able to choose 1 job to send the notification too, you can choose multiple, this also is the same for the built in job command calls eg., (/911). But don’t worry, this wont force you to update all of our scripts, as the previous single job format can also be used.
Fix
  • Fixed the on/off duty locals method showing blips on the map and playing the alert sound when a notification comes through when the player is off duty.
  • The callsign command is now removed and has been moved onto the settings tab on the large UI.
Edit
  • Added more data to the GetPlayerInfo() export.

08/03/2022

Files Changed:
  • All files
  • Specific Files
Update Type:
  • Mandatory
  • Optional
Changelog:
PLEASE READ IMPORTANT!!!
The method of adding notifications has changed. Please see here for the new method. To use this, and future versions this does mean that you will need to REDO ALL OF YOUR CURRENT NOTIFICATIONS. Its a fairly quick process though, just a lot of copy paste.
This does have a couple of benefits such as being more optimised and more user friendly but we had to do this to fix a syncing issue.
Edit
  • If no blip data is sent, the blip will not show on the pause menu map; to allow the use of /311 calls to not show the location etc.
  • Optimised the client side of police alerts and the framework getjob code.
  • Updated compatibility with the new oxmysql method.
  • Optimised and simplified the UI notifications integrated into your other scripts.
  • Added checks for duplicate notifications in list.
Fix
  • Fixed some locales on the UI.
  • Fixed the units list not being scrollable.
  • Fixed the IsDispatcher client error.
  • Fixed an issue with assigning calls to a user as a dispatcher where it would show the user responding to the wrong call.
  • Disabled the ability to enable radio voice for non dispatchers on the large UI.
  • Fixed the client side playerblips error.
  • Fixed a server side related to the duty checks being triggered too early.
  • Fixed the issue where when responding to calls, it would show other users that you responded to the wrong call.
  • Fixed an error where when a dispatcher logged off it would not allow non dispatchers to receive calls.
  • Fixed an issue where when you logged in as a "non authorised job" and then switched to an "authorised job" it would not allow you to enable dispatcher mode.
  • Fixed hovering over notification blips when zoomed.
  • Fixed dispatcher sending wrong notification to group.
  • Fixed clicking on a notification not changing blip colour to green.
  • Fixed different screen resolutions.
  • Fixed an issue with getting the closest vehicle returning the wrong vehicle.
  • Fixed some issues with JS locales.
  • Fixed the units list not scrolling when full.

18/03/2022

Files Changed:
  • All files
  • Specific Files
Update Type:
  • Mandatory
  • Optional
Changelog:
Add
  • Added the distance to the call on the small UI which can auto update the distance.
Fix
  • Fixed notifications not auto deleting.

29/03/2022

Files Changed:
  • All files
  • Specific Files
Update Type:
  • Mandatory
  • Optional
Changelog:
Add
  • Added the option to choose a boat as your vehicle in the UI's settings.
  • Added a new option in the UI's settings to mute sound from notifications.
Edit
  • Add a config option to the police alerts to only find players who are speeding if they own the vehicle.
Fix
  • Fixed selecting multiple notifications when only clicking on one.
  • Fixed drag/drop being interrupted randomly.
  • Fixed matching notifications to pins when clicking on either one.

21/04/2022

Files Changed:
  • All files
  • Specific Files
1
fxmanifest.lua - (IMPORTANT)
2
client/main/client.lua - (IMPORTANT)
3
html (FULL FOLDER) - (IMPORTANT)Update Type:
Copied!
  • Mandatory
  • Optional
Changelog:
Fix
  • Fixed the distance counter not working for the first notification.
  • Security fixes for the UI.