This guide explains how the parking meter robbery script integrates with cd_dispatch (Codesign Dispatch).
The script sends alerts directly to cd_dispatch using the cd_dispatch:AddNotification event. When a parking meter is robbed and the alert is triggered, it creates a dispatch call with all necessary information.
In config.lua, make sure you have:
Config.DispatchSystem = 'cd_dispatch'Config.PoliceJobs = {
'police',
'sheriff',
-- Add any other police job names your server uses
}IMPORTANT: Make sure these job names match exactly with your server's job names in your framework (QBCore/ESX).
Config.Blips = {
['parkingmeter'] = {
sprite = 161, -- Blip sprite ID
color = 1, -- Blip color (1 = red)
scale = 0.8, -- Blip size
length = 2, -- Minutes the blip stays on map
sound = "Lose_1st", -- Sound effect (not used by cd_dispatch)
sound2 = "GTAO_FM_Events_Soundset",
offset = false, -- Not used by cd_dispatch
flash = false, -- Make blip flash
radius = 0 -- Blip radius (0 = no radius)
}
}When a parking meter robbery occurs, the following data is sent to cd_dispatch:
{
job_table = {'police', 'sheriff'},
coords = vector3(x, y, z),
title = '10-31 - Parking Meter Vandalism',
message = 'Suspicious activity reported at a parking meter at [Street Name]',
flash = 0,
unique_id = 'random_8_digit_number',
sound = 1,
blip = {
sprite = 161,
scale = 0.8,
colour = 1,
flashes = false,
text = 'Parking Meter Vandalism',
time = 2,
radius = 0
}
}0= No flash1= Flash (typically used for panic buttons)
CD_Dispatch has different sound types:
1= Normal dispatch sound (single beep)2= Double beep3= Panic sound4= Panic sound with distance play
For parking meter robberies, we use 1 (normal sound).
Sprite IDs (common ones):
- 161 = Generic dispatch marker
- 58 = Helicopter
- 431 = Store/shop
- 313 = Gunshot
- 515 = Speed camera
- 56 = Police station
Color IDs:
- 1 = Red
- 2 = Green
- 3 = Blue
- 4 = White
- 5 = Yellow
Time:
- Value in minutes (e.g.,
5= 5 minutes on map)
Radius:
- Value in game units (e.g.,
100= 100 unit radius circle) 0= No radius circle
CD_Dispatch uses the job_table array to determine which players receive the alert:
job_table = {'police', 'sheriff', 'highway'}Only players with these exact job names will receive the alert. Make sure to:
- Match job names exactly (case-sensitive)
- Include all police job variants on your server
- Players must be on-duty (if your server uses duty system)
Config.DispatchCode = "10-31" -- Police code
Config.DispatchTitle = "Parking Meter Vandalism" -- Alert titleConfig.DispatchMessage = "Suspicious activity reported at a parking meter"This will be combined with the street name automatically.
Edit Config.Blips['parkingmeter'] in config.lua:
Config.Blips = {
['parkingmeter'] = {
sprite = 431, -- Change to store icon
color = 5, -- Change to yellow
scale = 1.0, -- Make it bigger
length = 5, -- Keep on map for 5 minutes
flash = true, -- Make it flash
radius = 50 -- Add a 50-unit radius circle
}
}Config.PoliceJobs = {
'police',
'sheriff',
'state',
'highway',
'marshals'
}You can trigger a parking meter alert from other scripts:
-- Trigger alert at specific coordinates
local coords = vector3(x, y, z)
local streetName = "Main Street, Los Santos"
TriggerServerEvent('cd_dispatch:AddNotification', {
job_table = {'police', 'sheriff'},
coords = coords,
title = '10-31 - Parking Meter Vandalism',
message = 'Suspicious activity reported at a parking meter at ' .. streetName,
flash = 0,
unique_id = tostring(math.random(10000000, 99999999)),
sound = 1,
blip = {
sprite = 161,
scale = 0.8,
colour = 1,
flashes = false,
text = 'Parking Meter Vandalism',
time = 2,
radius = 0
}
})- Set minimum police to 0:
Config.MinimumPolice = 0- Make sure cd_dispatch is running:
ensure cd_dispatch
- Give yourself a crowbar:
/giveitem [your ID] weapon_crowbar 1
-
Rob a parking meter
-
Check that:
- Alert appears in cd_dispatch UI (small or large)
- Blip appears on map
- Sound plays (if not muted)
- Alert shows correct street name
- Only police jobs receive the alert
-
Check cd_dispatch is running:
ensure cd_dispatch refresh ensure parking-meter-robbery -
Verify job names match:
- Check your
qb-core/shared/jobs.luaor ESX job config - Job names are case-sensitive
- Example QBCore job:
['police'] = { label = 'Law Enforcement', defaultDuty = true, -- ... }
- Check your
-
Check on-duty status:
- If cd_dispatch has
Config.UseFrameworkDutySystem = true, players must be on-duty - Toggle duty with your framework's duty command
- If cd_dispatch has
-
Enable debug mode:
Config.Debug = true
Check server console for "Sent cd_dispatch alert"
-
Check blip time:
- Make sure
Config.Blips['parkingmeter'].lengthis greater than 0
- Make sure
-
Check blip visibility:
- Some blip sprites may not render properly
- Try changing sprite to 161 (standard dispatch marker)
-
Check map zoom:
- Some blips don't show when zoomed out
- Try zooming in on the map
-
Check if sounds are muted:
- In cd_dispatch settings, check sound control
- Unmute sounds if needed
-
Check sound parameter:
- Value should be
1,2,3, or4 - Invalid values may cause no sound
- Value should be
The script uses native GTA functions to get street names. If incorrect:
- This is a GTA limitation in some areas
- The game may not have street data for that location
- Consider adding custom zone detection if needed
-
Check job name:
- Use
/debug_dispatch(if enabled) to see your current job - Make sure it matches Config.PoliceJobs exactly
- Use
-
Check duty status:
- Make sure you're on-duty
- Some frameworks require toggling duty
-
Check cd_dispatch permissions:
- Make sure the job is configured in cd_dispatch config
- Check
cd_dispatch/config.luafor job settings
If you want to include vehicle information when robbing from a vehicle:
-- In the script where alert is triggered
local ped = PlayerPedId()
local vehicle = GetVehiclePedIsIn(ped, false)
if vehicle ~= 0 then
local plate = GetVehicleNumberPlateText(vehicle)
local model = GetDisplayNameFromVehicleModel(GetEntityModel(vehicle))
-- Include in message
endCD_Dispatch doesn't use priority in the same way as ps-dispatch, but you can use the flash parameter:
flash = 0= Normal priorityflash = 1= High priority (usually reserved for panic buttons)
CD_Dispatch uses numbered sound parameters:
sound = 1 -- Change to 2 for double beepIf you have player blips enabled in cd_dispatch, responding units will automatically show on the map.
The parking meter script is separate from panic buttons, but both work together in cd_dispatch.
If someone is in dispatcher mode, they'll see the parking meter alerts and can assign units.
CD_Dispatch will auto-delete old notifications based on its own config timer.
For cd_dispatch specific issues:
- Check cd_dispatch documentation
- Verify cd_dispatch is up to date
- Test with cd_dispatch's built-in test command:
/dispatchtest
For script issues:
- Enable
Config.Debug = true - Check server console
- Verify
Config.DispatchSystem = 'cd_dispatch' - Make sure job names match exactly
Config.PoliceJobs = {
'police',
'sheriff'
}
Config.Blips = {
['parkingmeter'] = {
sprite = 161,
color = 1,
scale = 0.8,
length = 2,
flash = false,
radius = 0
}
}Config.PoliceJobs = {
'police',
'sheriff',
'state',
'highway'
}
Config.Blips = {
['parkingmeter'] = {
sprite = 431,
color = 5,
scale = 1.0,
length = 5,
flash = false,
radius = 100
}
}Config.Blips = {
['parkingmeter'] = {
sprite = 161,
color = 1,
scale = 1.2,
length = 3,
flash = true, -- Makes it high priority
radius = 0
}
}