Dispatch system

Welcome to Dispatch system

Dispatch configuration, we have added some examples to simplify your work, but we strongly recommend that you hire or ask a developer for help so you don't have to problems within your server and everything works correctly!

If you use a dispatch system like qs-dispatch or another system in the market, you can configure it with the different alerts that can be created, this is just an example

For Client side

If use Config.Dispatch = 'client'
function DispatchNotify(coords)
	local playerData = exports['qs-dispatch']:GetPlayerInfo()

        TriggerServerEvent('qs-dispatch:server:CreateDispatchCall', {
            job = { 'police', 'sheriff', 'traffic', 'patrol' },
            callLocation = playerData.coords,
            callCode = { code = '10-15', snippet = 'Drug sell' },
            message = "A ".. playerData.sex.. " is selling drug in ".. playerData.street_1.. "",
            flashes = false,
            image = image or nil,
            blip = {
                sprite = 488,
                scale = 1.5,
                colour = 1,
                flashes = true,
                text = 'Hight Speed',
                time = (20 * 1000),     --20 secs
            }
        })
end

For Server side

If use Config.Dispatch = 'server'
RegisterNetEvent('drugs:server:NotifyCops')
AddEventHandler('drugs:server:NotifyCops', function(coords)
    local street = GetStreetNameAtCoord(coords.x, coords.y, coords.z)
    local street2 = GetStreetNameFromHashKey(street)
    TriggerEvent('qs-dispatch:server:CreateDispatchCall', {
        job = { 'police', 'sheriff', 'traffic', 'patrol' },
        callLocation = street,
        callCode = { code = '<CALL CODE>', snippet = '<CALL SNIPPED EX: 10-10>' },
        message = "Call Message",
        flashes = false, -- you can set to true if you need call flashing sirens...
        image = "URL", -- Url for image to attach to the call 
        --you can use the getSSURL export to get this url
        blip = {
            sprite = 488, --blip sprite
            scale = 1.5, -- blip scale
            colour = 1, -- blio colour
            flashes = true, -- blip flashes
            text = 'Hight Speed', -- blip text
            time = (20 * 1000), --blip fadeout time (1 * 60000) = 1 minute
        },
        otherData = {
        -- optional if you dont need this you can remove it and remember remove the `,` after blip end and this block
           {
               text = 'Red Obscure', -- text of the other data item (can add more than one)
               icon = 'fas fa-user-secret', -- icon font awesome https://fontawesome.com/icons/
           }
         }
    })
end)

Last updated