Using ps-dispatch (v2)
Using ps-dispatch (v2) with custom alerts for mz-resources requires amending the ps-dispatch files themselves.
Ensure you follow the instructions from ps-dispatch to ensure that the dispatch system is operating in your server:
Download ZIP
Make sure your qb-core is fully updated to the latest version.
Drag and drop resource into your server files
Start resource through server.cfg
Drag and drop sounds folder into interact-sound\client\html\sounds
Configure your language
Restart your server.
In shared/config.lua look for "Config.blips" (by default it commences on line 46) and add the following custom blip configurations anywhere within (easiest to put them at the end before the final }):
--MZ-RESOURCES-- ---------------- ['atmdevice'] = { radius = 0, sprite = 486, color = 1, scale = 1.5, length = 2, sound = 'Lose_1st', sound2 = 'GTAO_FM_Events_Soundset', offset = false, flash = false }, ['atmboom'] = { radius = 0, sprite = 622, color = 1, scale = 1.5, length = 2, sound = 'Lose_1st', sound2 = 'GTAO_FM_Events_Soundset', offset = false, flash = false }, ['containerrobbery'] = { radius = 0, sprite = 479, color = 15, scale = 1.5, length = 2, sound = 'Lose_1st', sound2 = 'GTAO_FM_Events_Soundset', offset = false, flash = true }, ['fibheist'] = { radius = 0, sprite = 486, color = 1, scale = 1.5, length = 2, sound = 'Lose_1st', sound2 = 'GTAO_FM_Events_Soundset', offset = false, flash = true }, ['fibboom'] = { radius = 0, sprite = 622, color = 1, scale = 1.5, length = 2, sound = 'Lose_1st', sound2 = 'GTAO_FM_Events_Soundset', offset = false, flash = true }, ['mdmalab'] = { radius = 300, sprite = 80, color = 44, scale = 1.5, length = 2, sound = 'Lose_1st', sound2 = 'GTAO_FM_Events_Soundset', offset = false, flash = true }, ['mdmatheft'] = { radius = 300, sprite = 51, color = 44, scale = 1.5, length = 2, sound = 'Lose_1st', sound2 = 'GTAO_FM_Events_Soundset', offset = false, flash = false }, ['methlab'] = { radius = 0, sprite = 521, color = 2, scale = 1.5, length = 2, sound = 'Lose_1st', sound2 = 'GTAO_FM_Events_Soundset', offset = false, flash = true }, ['mz-armourguard-hit'] = { radius = 0, sprite = 67, color = 25, scale = 1.8, length = 2, sound = 'Lose_1st', sound2 = 'GTAO_FM_Events_Soundset', offset = false, flash = true }, ['mz-drugrun'] = { radius = 300, sprite = 10, color = 44, scale = 1.8, length = 2, sound = 'Lose_1st', sound2 = 'GTAO_FM_Events_Soundset', offset = false, flash = true }, ['mz-fishing'] = { radius = 500, sprite = 10, color = 49, scale = 0.5, length = 2, sound = 'Lose_1st', sound2 = 'GTAO_FM_Events_Soundset', offset = false, flash = true }, ['mz-need4speed'] = { radius = 0, sprite = 198, color = 1, scale = 1.8, length = 2, sound = 'Lose_1st', sound2 = 'GTAO_FM_Events_Soundset', offset = false, flash = true }, ['mz-storerobbery-register'] = { radius = 0, sprite = 628, color = 1, scale = 1.5, length = 2, sound = 'Lose_1st', sound2 = 'GTAO_FM_Events_Soundset', offset = false, flash = false }, ['mz-storerobbery-safe'] = { radius = 0, sprite = 350, color = 1, scale = 1.5, length = 2, sound = 'Lose_1st', sound2 = 'GTAO_FM_Events_Soundset', offset = false, flash = false }, ['mz-storerobbery-liquor'] = { radius = 0, sprite = 350, color = 1, scale = 1.5, length = 2, sound = 'Lose_1st', sound2 = 'GTAO_FM_Events_Soundset', offset = false, flash = false }, ['oxyrunping'] = { radius = 0, sprite = 469, color = 52, scale = 1.5, length = 2, sound = 'Lose_1st', sound2 = 'GTAO_FM_Events_Soundset', offset = true, flash = true }, ['weaponraid'] = { radius = 120, sprite = 576, color = 1, scale = 1.5, length = 2, sound = 'Lose_1st', sound2 = 'GTAO_FM_Events_Soundset', offset = false, flash = true }, ['yachtraidplant'] = { radius = 0, sprite = 455, color = 1, scale = 1.5, length = 2, sound = 'Lose_1st', sound2 = 'GTAO_FM_Events_Soundset', offset = false, flash = false }, ['yachtraidboom'] = { radius = 0, sprite = 303, color = 1, scale = 1.5, length = 2, sound = 'Lose_1st', sound2 = 'GTAO_FM_Events_Soundset', offset = false, flash = true },
In client/alerts.lua, add the following custom exports. If you add them at the end they will be added after like 753:
----------------
--MZ-RESOURCES--
----------------
-----------------
--MZ-ATMROBBERY--
-----------------
-- mz-atmrobbery: Device installed
local function mzatmrobberyDevice()
local coords = GetEntityCoords(cache.ped)
local dispatchData = {
message = "Device installed on ATM",
codeName = 'atmdevice',
code = '000',
icon = 'fas fa-fire',
priority = 2,
coords = coords,
gender = GetPlayerGender(),
street = GetStreetAndZone(coords),
jobs = { 'leo' }
}
TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
end
exports('mzatmrobberyDevice', mzatmrobberyDevice)
-- exports['ps-dispatch']:mzatmrobberyDevice()
-- mz-atmrobbery: Kaboom
local function mzatmrobberyExplosion()
local coords = GetEntityCoords(cache.ped)
local dispatchData = {
message = "An explosive just detonated",
codeName = 'atmboom',
code = '000',
icon = 'fas fa-fire',
priority = 2,
coords = coords,
gender = GetPlayerGender(),
street = GetStreetAndZone(coords),
jobs = { 'leo' }
}
TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
end
exports('mzatmrobberyExplosion', mzatmrobberyExplosion)
-- exports['ps-dispatch']:mzatmrobberyExplosion()
------------------
--MZ-ARMOURGUARD--
------------------
-- mz-armourguard heist
local function mzarmourguard()
local coords = GetEntityCoords(cache.ped)
local dispatchData = {
message = "Armour Guard Compromised",
codeName = 'mz-armourguard-hit',
code = '000',
icon = 'fas fa-fire',
priority = 2,
coords = coords,
gender = GetPlayerGender(),
street = GetStreetAndZone(coords),
jobs = { 'leo' }
}
TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
end
exports('mzarmourguard', mzarmourguard)
-- exports['ps-dispatch']:mzarmourguard()
----------------
--MZ-DOCKLANDS--
----------------
-- mz-docklands heist
local function mzdocklands()
local coords = GetEntityCoords(cache.ped)
local dispatchData = {
message = "Container Lock Breach",
codeName = 'containerrobbery',
code = '000',
icon = 'fas fa-fire',
priority = 2,
coords = coords,
gender = GetPlayerGender(),
street = GetStreetAndZone(coords),
jobs = { 'leo' }
}
TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
end
exports('mzdocklands', mzdocklands)
-- exports['ps-dispatch']:mzdocklands()
--------------
--MZ-DRUGRUN--
--------------
-- mz-drugrun
local function mzdrugrun()
local coords = GetEntityCoords(cache.ped)
local dispatchData = {
message = "Suspected drug meet...",
codeName = 'mz-drugrun',
code = '000',
icon = 'fas fa-fire',
priority = 2,
coords = coords,
gender = GetPlayerGender(),
street = GetStreetAndZone(coords),
jobs = { 'leo' }
}
TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
end
exports('mzdrugrun', mzdrugrun)
-- exports['ps-dispatch']:mzdrugrun()
---------------
--MZ-FIBHEIST--
---------------
-- mz-fibheist - Heist start
local function mzfibheistStart()
local coords = GetEntityCoords(cache.ped)
local dispatchData = {
message = "FIB HQ Compromised",
codeName = 'fibheist',
code = '000',
icon = 'fas fa-fire',
priority = 2,
coords = coords,
gender = GetPlayerGender(),
street = GetStreetAndZone(coords),
jobs = { 'leo' }
}
TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
end
exports('mzfibheistStart', mzfibheistStart)
-- exports['ps-dispatch']:mzfibheistStart()
-- mz-fibheist - Boom
local function mzfibheistBoom()
local coords = GetEntityCoords(cache.ped)
local dispatchData = {
message = "An explosive just detonated!",
codeName = 'fibboom',
code = '000',
icon = 'fas fa-fire',
priority = 2,
coords = coords,
gender = GetPlayerGender(),
street = GetStreetAndZone(coords),
jobs = { 'leo' }
}
TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
end
exports('mzfibheistBoom', mzfibheistBoom)
-- exports['ps-dispatch']:mzfibheistBoom()
-----------
--MZ-MDMA--
-----------
-- mz-mdma breach
local function mzmdma()
local coords = GetEntityCoords(cache.ped)
local dispatchData = {
message = "Humane Labs Compromised",
codeName = 'mdmalab',
code = '000',
icon = 'fas fa-fire',
priority = 2,
coords = coords,
gender = GetPlayerGender(),
street = GetStreetAndZone(coords),
jobs = { 'leo' }
}
TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
end
exports('mzmdma', mzmdma)
-- exports['ps-dispatch']:mzmdma()
-- mz-mdma theft
local function mzmdmaTheft()
local coords = GetEntityCoords(cache.ped)
local dispatchData = {
message = "Chemicals Stolen",
codeName = 'mdmatheft',
code = '000',
icon = 'fas fa-fire',
priority = 2,
coords = coords,
gender = GetPlayerGender(),
street = GetStreetAndZone(coords),
jobs = { 'leo' }
}
TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
end
exports('mzmdmaTheft', mzmdmaTheft)
-- exports['ps-dispatch']:mzmdmaTheft()
-----------
--MZ-METH--
-----------
-- mz-meth breach
local function mzmeth()
local coords = GetEntityCoords(cache.ped)
local dispatchData = {
message = "Humane Labs Hacked",
codeName = 'methlab',
code = '000',
icon = 'fas fa-fire',
priority = 2,
coords = coords,
gender = GetPlayerGender(),
street = GetStreetAndZone(coords),
jobs = { 'leo' }
}
TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
end
exports('mzmeth', mzmeth)
-- exports['ps-dispatch']:mzmeth()
-----------------
--MZ-NEED4SPEED--
-----------------
-- mz-need4speed
local function mzneed4speed()
local coords = GetEntityCoords(cache.ped)
local dispatchData = {
message = "Stolen Vehicle Tracker",
codeName = 'mz-need4speed',
code = '000',
icon = 'fas fa-fire',
priority = 2,
coords = coords,
gender = GetPlayerGender(),
street = GetStreetAndZone(coords),
jobs = { 'leo' }
}
TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
end
exports('mzneed4speed', mzneed4speed)
-- exports['ps-dispatch']:mzneed4speed()
-------------
--MZ-OXYRUN--
-------------
-- mz-oxyrun
local function mzoxyrun()
local coords = GetEntityCoords(cache.ped)
local dispatchData = {
message = "Suspicious Hand off",
codeName = 'oxyrunping',
code = '000',
icon = 'fas fa-fire',
priority = 2,
coords = coords,
gender = GetPlayerGender(),
street = GetStreetAndZone(coords),
jobs = { 'leo' }
}
TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
end
exports('mzoxyrun', mzoxyrun)
-- exports['ps-dispatch']:mzoxyrun()
-------------------
--MZ-STOREROBBERY--
-------------------
-- mz-storerobbery Registers
local function mzRegisterStoreRobbery(camId)
local coords = GetEntityCoords(cache.ped)
local dispatchData = {
message = "Store Register Hit",
codeName = 'mz-storerobbery-register',
code = '000',
icon = 'fas fa-cash-register',
priority = 2,
coords = coords,
gender = GetPlayerGender(),
street = GetStreetAndZone(coords),
camId = camId,
jobs = { 'leo' }
}
TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
end
exports('mzRegisterStoreRobbery', mzRegisterStoreRobbery)
-- exports['ps-dispatch']:mzRegisterStoreRobbery(camId)
-- mz-storerobbery Safe
local function mz711StoreRobbery(camId)
local coords = GetEntityCoords(cache.ped)
local dispatchData = {
message = "Convenience Store Robbery",
codeName = 'mz-storerobbery-safe',
code = '000',
icon = 'fas fa-store',
priority = 2,
coords = coords,
gender = GetPlayerGender(),
street = GetStreetAndZone(coords),
camId = camId,
jobs = { 'leo' }
}
TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
end
exports('mz711StoreRobbery', mz711StoreRobbery)
-- exports['ps-dispatch']:mz711StoreRobbery(camId)
-- mz-storerobbery Liquor
local function mzLiquorStoreRobbery(camId)
local coords = GetEntityCoords(cache.ped)
local dispatchData = {
message = "Liquor Store Robbery",
codeName = 'mz-storerobbery-liquor',
code = '000',
icon = 'fas fa-store',
priority = 2,
coords = coords,
gender = GetPlayerGender(),
street = GetStreetAndZone(coords),
camId = camId,
jobs = { 'leo' }
}
TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
end
exports('mzLiquorStoreRobbery', mzLiquorStoreRobbery)
-- exports['ps-dispatch']:mzLiquorStoreRobbery(camId)
-----------------
--MZ-YACHTHEIST--
-----------------
-- mz-yachtheist - Mission Start
local function mzyachtheistStart()
local coords = GetEntityCoords(cache.ped)
local dispatchData = {
message = "Yacht Security Breach",
codeName = 'yachtraidplant',
code = '000',
icon = 'fas fa-fire',
priority = 2,
coords = coords,
gender = GetPlayerGender(),
street = GetStreetAndZone(coords),
jobs = { 'leo' }
}
TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
end
exports('mzyachtheistStart', mzyachtheistStart)
-- exports['ps-dispatch']:mzyachtheistStart()
-- mz-yachtheist - Kaboom
local function mzyachtheistBoom()
local coords = GetEntityCoords(cache.ped)
local dispatchData = {
message = "Explosion Detected",
codeName = 'yachtraidboom',
code = '000',
icon = 'fas fa-fire',
priority = 2,
coords = coords,
gender = GetPlayerGender(),
street = GetStreetAndZone(coords),
jobs = { 'leo' }
}
TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
end
exports('mzyachtheistBoom', mzyachtheistBoom)
-- exports['ps-dispatch']:mzyachtheistBoom()
-----------------
--MZ-WEAPONRAID--
-----------------
-- mz-weaponraid
local function mzweaponraid()
local coords = GetEntityCoords(cache.ped)
local dispatchData = {
message = "Fort Zancudo Alarm!",
codeName = 'weaponraid',
code = '000',
icon = 'fas fa-fire',
priority = 2,
coords = coords,
gender = GetPlayerGender(),
street = GetStreetAndZone(coords),
jobs = { 'leo' }
}
TriggerServerEvent('ps-dispatch:server:notify', dispatchData)
end
exports('mzweaponraid', mzweaponraid)
-- exports['ps-dispatch']:mzweaponraid()
If you are unable to set up the above, join: https://discord.gg/CqNYvE3CkA and a copy of the dispatch with the above mz-resources edits has been uploaded and will be maintained.
Last updated