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.
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.
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.
Paid Resources
You can find this event in [robberies_creator/integrations/sv_integrations.lua]
.
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
Was this helpful?