Custom Dispatch Calls
How do I ensure that I receive notifications about robberies and other custom calls in the dispatch? It is necessary to make changes to the exports that scripts have or that have been changed to cust
How to create complete new call:
Go to
akre_dispatch/client/c_dispatches.lua
Change
MyNewDispatchCall()
to your own dispatch call name.
It May be:
local function PlaneHeist()
local function ArtGalleryHeist()
local function TrainHeist()
And don't foget also change
exports('MyNewDispatchCall', MyNewDispatchCall)
with the same name as you named the dispatch call.
local function MyNewDispatchCall()
local plyData = QBCore.Functions.GetPlayerData() -- or for ESX = local plyData = ESX.GetPlayerData()
local ped = PlayerPedId()
local coords = GetEntityCoords(ped)
local substreet = GetStreetNameAtCoord(coords.x, coords.y, coords.z)
local streetname = GetStreetNameFromHashKey(substreet)
local title = _L['your_tittle_name'] -- Go to locale/loc.lua and add ['your_tittle_name'] = 'Code|Tittle',
local text = "On the " .. streetname .. " has been a " .. gender .. '.'
for k, v in pairs(Config.Jobs) do
local job = v
TriggerServerEvent('akre-dispatch:server:NewDispatch', job, title, text, coords)
end
end
exports('MyNewDispatchCall', MyNewDispatchCall)
```
Now go to akre_dispatch/locale/loc.lua - and use this template to create the dispatch code and name that will be shown for the call:
['your_tittle_name'] = 'Code|Name',
Change the text of your_tittle_name to your own in both files, i.e. c_dispatches.lua and loc.lua. It should look something like this
['10-83_title'] = '10-83|New Dispatch Call',
Now go to akre_dispatch/client/c_blips.lua and lets create a blip for our new dispatch call.
elseif title == _L['10-83_title'] then blipSprite = 837 blipColor = 76 blipScale = 0.9 blipLength = 45 blipText = "911" Sound1, SoundVolume = 'dsp_beep', 10.0
The title have to match in every three files to make the correct connection!
_L['10-83_title']
Move back to akre_dispatch/client/c_dispatches.lua and edit your description
local text = "On the " .. streetname .. " has been a New Dispatch Call with: " .. gender .. '.'
Now customize which jobs receives the dispatch call
-- ALL JOBS: for k, v in pairs(Config.Jobs) do local job = v TriggerServerEvent('akre-dispatch:server:NewDispatch', job, title, text, coords) end -- POLICE JOBS ONLY: for k, v in pairs(Config.PoliceJobs) do local job = v TriggerServerEvent('akre-dispatch:server:NewDispatch', job, title, text, coords, panic) end -- OR CUSTOM local job = "fire" TriggerServerEvent('akre-dispatch:server:NewDispatch', job, title, text, coords, panic)
If you have added a new dispatch call that has a new dispatch code or dispatch code does not remember to go to akre_dispatch/ui/app.js and find const TitleColorMapping and add:
'10-83': { color: '#7b0e0a', text: 'Code-69' }, // If you dont want to use text just let the '' empty // If didn't enter code enter first letter of title like this: 'New Dispatch': { color: '#7b0e0a', text: 'Code-69' },
If you have all this done then create your export: exports['akre_dispatch']:MyNewDispatchCall and follow another steps:
Examples how to add calls to dispatch
QB-Jewelery
Find this trigger:

and replace them with this:
exports["akre_dispatch"]:SuspiciousActivity()

Find this trigger:

And replace them with:
exports["akre_dispatch"]:JeweleryRobbery()

Now Restart your server and Dispatch should shows the calls if alarm is triggered...
Last updated