An Event-Based Advanced FiveM QBCore Job Dispatch / 10-System Script,
Originally Made by NevoG, Link to old script here.
Personal Account | |
---|---|
Discord Server |
- qb-core
- qb-policejob
- pma-voice
Add this line at qb-core/server/player.lua
line 272:
TriggerEvent('QBCore:Server:OnMetaDataUpdate', self.PlayerData.source, meta, val)
Your method should look like this:
function self.Functions.SetMetaData(meta, val)
if not meta or type(meta) ~= 'string' then return end
if meta == 'hunger' or meta == 'thirst' then
val = val > 100 and 100 or val
end
self.PlayerData.metadata[meta] = val
self.Functions.UpdatePlayerData()
-- Triggering our event:
TriggerEvent('QBCore:Server:OnMetaDataUpdate', self.PlayerData.source, meta, val)
end
- F3 - Open Active Officers List
- /dispatch 0 - Drag Menu
- /dispatch - Toggle Menu
- /callsign
[callsign]
- To set your callsign (QBCore Command)
Head to config.lua
and under Config.ToggleKey
change it to the key you desire.
Also, you can change it on the client-side (only for you) in the Game Settings.
This is a frequently asked question, and the answer is simple. For this example, we'll add job support for beanmachine
.
Head to our FL-Dispatch Config Editor Repository right here.
Add your new job to the Config.Jobs
table. It should look like this:
Config.Jobs = { "police", "ambulance", "taxi", "beanmachine" }
Add the colors for your beanmachine
job. Copy the format of the ambulance
job or any other job and modify as needed.
We would want to modify the job's name, label and different colors:
"beanmachine": {
"label": "Active Beanmachine Workers",
"colors": {
"backgroundColor": "#682900",
"foregroundColor": "white"
},
"ranges": [
{
"start": 1,
"end": 19,
"colors": {
"backgroundColor": "#003F68",
"foregroundColor": "white"
}
},
{
"start": 31,
"end": 39,
"colors": {
"backgroundColor": "#6F5900",
"foregroundColor": "white"
}
}
],
"special": [
{
"prefix": "W",
"colors": {
"backgroundColor": "#50008F",
"foregroundColor": "white"
}
}
]
}
Feel free to edit until you get the desired result. If you encounter any issues, you can copy the original content from the source code or contact me for assistance.
3. It shows I have an update, how can I update the script without losing my config/colors modifications?
Simply save your current colors.json
and config.lua
somewhere in your computer.
Install the newer version of fl-dispatch, upload it to your server resources folder and drag the older config files into the newer version folder. But of course, check if there was an update to the config files and if so include the newer text content into your older version ones. And you're done, you have successfully updated fl-dispatch.
This project is under MIT license. See the file LICENSE for more details.