2023-07-03 14-51-03.mkv (5.5 MB)
Code After S*x Dispatch is a simple dispatch system.
Features
- Working With QBCore and ESX Frameworks.
- You can see the name of the nearest EMS and Police unit to the scene.
- You can waypoint the coordinate where the crime is located by pressing βZβ
- You can use this system simply, it is easy to use.
Example from QB-StoreRobbery
Config = {
DispatchInfo = {
header = "POLICE ALERT",
event = "Store Robbery",
callsign = "19-02-04",
forwho = "police",
blips = {
blipText = "Store Robbery Combination Try",
blipSprite = 153,
blipColour = 71,
blipScale = 0.7,
blipTime = 2, -- minute
}
}
}
GetStreetName = function(coords)
local hashKey = GetStreetNameAtCoord(coords.x, coords.y, coords.z)
local streetName = GetStreetNameFromHashKey(hashKey)
return streetName
end
RegisterNUICallback('TryCombination', function(data, cb)
QBCore.Functions.TriggerCallback('qb-storerobbery:server:isCombinationRight', function(combination)
if tonumber(data.combination) ~= nil then
if tonumber(data.combination) == combination then
TriggerServerEvent("qb-storerobbery:server:SafeReward", currentSafe)
TriggerServerEvent("qb-storerobbery:server:setSafeStatus", currentSafe)
SetNuiFocus(false, false)
SendNUIMessage({
action = "closeKeypad",
error = false,
})
currentSafe = 0
takeAnim()
else
-- TriggerEvent("police:SetCopAlert")
local coords = GetEntityCoords(PlayerPedId())
TriggerServerEvent("cas-sendDispatch",coords, Config.DispatchInfo, GetStreetName(coords))
SetNuiFocus(false, false)
SendNUIMessage({
action = "closeKeypad",
error = true,
})
currentSafe = 0
end
end
cb("ok")
end, currentSafe)
end)
Updates;
- Added Shot Alert
- Added driveBy alert
- Added Civdown alert
- Added Carjacking alert
How can i use this script?
- Install baseevents fivem script Download on github
- Install CAS-Dispatch
- Set config file according to your server.
- And start scripts.
How can i add dispatch alert for store robbery?
- Add dispatch settings to config like this;
Config.StoreRobbery = {
header = "Store Robbery", // header
event = "A market is being robbed!", // footer
callsign = "55-88", // callsign code
forwho = {"police", "sheriff"}, //
blips = {
blipText = "Store Robbery", // Blip Name
blipSprite = 153, // Blip Icon
blipColour = 71, // Blip Colour
blipScale = 0.7, // Blip Scale
blipTime = 2, // Blip Time
}
}
- Then open client.lua and type this;
RegisterNetEvent("youreventName")
AddEventHandler("youreventName",function()
local coords = GetEntityCoords(GetPlayerPed(-1))
TriggerServerEvent("cas-sendDispatch",coords, Config.StoreRobbery, GetStreetName(coords))
end)
- Finally go to your store robbery script I will give you an example via qb-storerobbery
- Find this part;
TriggerServerEvent("qb-storerobbery:server:callCops", "cashier", currentRegister, streetLabel, pos)
- Then Replace with this;
TriggerEvent("youreventName")
Note
yourEventName can be any text you want.
Code is accessible | YES |
Subscription-based | NO |
Lines (approximately) | +100 |
Requirements | QBCore/ESX |
Support | YES |