Configuration
Here we'll see how to configure your own Codes.
Configuring the Dispatch
Setting up your framework & SQL
We must configure the resource with the framework and SQL script used for our server. So for that, let's make some changes.
List of supported frameworks
ESX Old (1.1)
ESX
ESX Legacy
ESX-Legacy
QB-Core
QB-Core
List of supported SQL scripts
MySQL Async
mysql-async
OxMySQL
oxmysql
Example
Setting up your notification system
We must configure the resource with the notification system used for our server. So for that, let's make some changes.
List of supported notification systems:
OKOK Notify
okokNotify
ESX Notification
ESX
QB-Core Notification
QB-Core
Default Notification
default
Custom Notification System
custom
If using a custom notification system, please refer to this documentation to configure the notification system.
Example
Setting up the jobs
We must configure the jobs that can use the dispatch system. So for that, you must add to the table your wanted jobs to work.
Example
Configuring the Codes
How are the codes working
Before we see on how to add more codes, let's get an overview about how are the codes made and what are the contents of the tables.
Overview of a Code:
List of the table contents for the Code:
Name
string
This is the name of the code that will show when triggered.
Description
string
This is the description of the code that will show when triggered.
Type
string (code/panicButton)
This is to tell if ug-dispatch must say if it's a code or a panic button. The values are code/panicButton
Code
number
This determines which number to use if you are using commands (example: /code 1)
Color
string
This is the color of the code. The background of the dispatch will change determining which code was triggered.
DefaultKey
string
This is to set a default key to trigger the code. The key can be changed by the player in FiveM settings.
Jobs
table
Sound
table
Must check this list to get more details.
For the code color, you can use this website to get a color (must be in HEX format).
List of the table content's sound for the Code:
Enable
boolean
This is to enable or disable the sound that will be triggered when the code is called.
Name
string
This is the name of the sound file that can be found in the folder web/build.
Volume
number
This is the volume of the sound.
To add custom sounds, please refer to this documentation.
Example of a new code (for EMS)
Configuring a Custom Notification System
You can always use a custom notification system in our scripts. To do that, please refer to the code bellow:
Adding a new custom sound for codes
To add a new sound for the codes, you must simply download the sound you like and the drag it to the folder web/build. There, you will find the code.ogg and code99.ogg sounds refering to the default sounds of the dispatch.
Last updated
Was this helpful?