Resource Integration

A guide to help customers understand where to replace default police notifications with cd_dispatch notifications.

ESX Resources

The links below will take you to resources from the official ESX GitHub. The highlighted line you will see is the default dispatch alert. All you need to do is replace that line with the code snippet we have provided below. Be sure to customise the variables in the event to suit your server's needs.

Step 1 - Find the default dispatch alert

Click any of the links below and find the highlighted line; this will be the default dispatch alert for that resource - EXAMPLE.

Step 2 - Replace the default dispatch alert

Find the same line in that resource on your server and replace that line with the code snippet provided below.

Copy and paste this code snippet over the existing police alert.
local data = exports['cd_dispatch']:GetPlayerInfo()
TriggerServerEvent('cd_dispatch:AddNotification', {
    job_table = {'police', }, 
    coords = data.coords,
    title = '10-15 - Store Robbery',
    message = 'A '..data.sex..' robbing a store at '..data.street, 
    flash = 0,
    unique_id = data.unique_id,
    sound = 1,
    blip = {
        sprite = 431, 
        scale = 1.2, 
        colour = 3,
        flashes = false, 
        text = '911 - Store Robbery',
        time = 5,
        radius = 0,
    }
})

Step 3 - Customise the variables

Be sure to customise the variables in the event to suit your server's needs.

QBCore Resources

The links below will take you to resources from the official QBCore GitHub. The highlighted line you will see is the default dispatch alert. All you need to do is replace that line with the code snippet we have provided below. Be sure to customise the variables in the event to suit your server's needs.

Step 1 - Find the default dispatch alert

Click any of the links below and find the highlighted line; this will be the default dispatch alert for that resource - EXAMPLE.

Step 2 - Replace the default dispatch alert

Find the same line in that resource on your server and replace that line with the code snippet provided below.

Copy and paste this code snippet over the existing police alert.
local data = exports['cd_dispatch']:GetPlayerInfo()
TriggerServerEvent('cd_dispatch:AddNotification', {
    job_table = {'police', }, 
    coords = data.coords,
    title = '10-15 - Store Robbery',
    message = 'A '..data.sex..' robbing a store at '..data.street, 
    flash = 0,
    unique_id = data.unique_id,
    sound = 1,
    blip = {
        sprite = 431, 
        scale = 1.2, 
        colour = 3,
        flashes = false, 
        text = '911 - Store Robbery',
        time = 5,
        radius = 0,
    }
})

Step 3 - Customise the variables

Be sure to customise the variables in the event to suit your server's needs.

Our goal is to get as many resources pre-configured to be compatible with our dispatch, or at the very least; we will try to add them here for you to do yourself.

You can find this event in [robberies_creator/integrations/sv_integrations.lua].

Fully replace the existing event with this new edited one.
RegisterNetEvent("robberies_creator:alertedPolice", function(coords, message)
    TriggerClientEvent('cd_dispatch:AddNotification', -1, {
        job_table = {'police', },
        coords = coords,
        title = '10-15 - Robbery',
        message = message,
        flash = 0,
        unique_id = tostring(math.random(0000000,9999999)),
        sound = 1,
        blip = {
            sprite = 431,
            scale = 1.2,
            colour = 3,
            flashes = false,
            text = '911 - Robbery',
            time = 5,
            radius = 0,
        }
    })
  end)

Be sure to customise the variables in the event to suit your server's needs.

Last updated

Logo

Codesign Software © All rights reserved