Integrations

ESX

1

esx_ambulancejob

View the code on GitHub: esx_ambuancejob/client/main.lua

Add the code snippet exactly as seen in the screenshot below.

esx_ambuancejob/client/main.lua — line 189
  local data = exports['cd_dispatch3d']:GetPlayerInfo()
  TriggerServerEvent('cd_dispatch:AddNotification', {
    job_table = {'police', 'ambulance'},
    coords    = data.coords,
    title     = '10-10 - Injured Person',
    message   = 'A ' .. data.sex .. ' injured at ' .. data.street,
    flash     = false,
    sound     = 1,
    blip = {
      sprite  = 305,
      scale   = 1.2,
      colour  = 1,
      flashes = true,
      text    = '10-10 - Injured Person',
      time    = 5,
      radius  = 0,
    }
  })


QBCore

2

Replace the Default Dispatch Alert

Find the same line in your server’s resource and replace it with the new code snippet provided below.

local data = exports['cd_dispatch3d']: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,
    sound = 1,
    blip = {
        sprite = 431, 
        scale = 1.2, 
        colour = 3,
        flashes = false, 
        text = '911 - Store Robbery',
        time = 5,
        radius = 0,
    }
})
Before and After Example (from a random resource)
3

Customise the Variables

Make sure to adjust the variables in the event to match your server’s setup and preferences.



Free Resources

ps-mdt

1

View the code on GitHub: ps-mdt/server/main.lua

REPLACE the code exactly as seen in the screenshot below.

ps-mdt/server/main.lua — line 125
local dispatchResources = {
    { name = 'ps-dispatch', export = 'GetDispatchCalls' },
    { name = 'cd_dispatch3d', export = 'GetDispatchCalls_PS' },
    { name = 'cd_dispatch', export = 'GetDispatchCalls_PS' },
}
for _, res in ipairs(dispatchResources) do
    if GetResourceState(res.name) == 'started' then
        return exports[res.name][res.export]()
    end
end
2

View the code on GitHub: ps-mdt/server/main.lua

REPLACE the code exactly as seen in the screenshot below.

ps-mdt/server/main.lua — line 256
local dispatchResources = {
	{ name = 'ps-dispatch', export = 'GetDispatchCalls' },
	{ name = 'cd_dispatch3d', export = 'GetDispatchCalls_PS' },
	{ name = 'cd_dispatch', export = 'GetDispatchCalls_PS' },
}
for _, res in ipairs(dispatchResources) do
	if GetResourceState(res.name) == 'started' then
		calls = exports[res.name][res.export]()
		break
	end
end
3

View the code on GitHub: ps-mdt/server/main.lua

REPLACE the code exactly as seen in the screenshot below.

ps-mdt/server/main.lua — line 321
local dispatchResources = {
	{ name = 'ps-dispatch', export = 'GetDispatchCalls' },
	{ name = 'cd_dispatch3d', export = 'GetDispatchCalls_PS' },
	{ name = 'cd_dispatch', export = 'GetDispatchCalls_PS' },
}
for _, res in ipairs(dispatchResources) do
	if GetResourceState(res.name) == 'started' then
		cb(exports[res.name][res.export]())
		break
	end
end
4

View the code on GitHub: ps-mdt/client/main.lua

REPLACE the code exactly as seen in the screenshot below.

ps-mdt/client/main.lua — line
CreateThread(function()
    local dispatchResources = {
		{ name = 'ps-dispatch' },
		{ name = 'cd_dispatch3d' },
		{ name = 'cd_dispatch' },
	}
	for _, res in ipairs(dispatchResources) do
		if GetResourceState(res.name) == 'started' then
			TriggerServerEvent("ps-mdt:dispatchStatus", true)
			break
		end
	end
end)

Last updated

Was this helpful?