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:

  1. Go to akre_dispatch/client/c_dispatches.lua

  2. Change MyNewDispatchCall() to your own dispatch call name.

It May be:

local function PlaneHeist()
local function ArtGalleryHeist()
local function TrainHeist()
  1. 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)
```
  1. 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:

  1. 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

If u don't want to use Code just delete it and use it in this form: ['10-83_title'] = 'New Dispatch Call',

  1. Now go to akre_dispatch/client/c_blips.lua and lets create a blip for our new dispatch call.

  1. Move back to akre_dispatch/client/c_dispatches.lua and edit your description

  2. Now customize which jobs receives the dispatch call

  3. 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:

  4. 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:

Before

and replace them with this:

exports["akre_dispatch"]:SuspiciousActivity()

After

Find this trigger:

Before

And replace them with:

exports["akre_dispatch"]:JeweleryRobbery()

After

Last updated