This guide explains how the parking meter robbery script integrates with ps-dispatch.
The script uses ps-dispatch's native event structure to send alerts directly to the dispatch system. When a parking meter is robbed and the alert is triggered, it sends a properly formatted dispatch call.
In config.lua, make sure you have:
Config.DispatchSystem = 'ps-dispatch'Config.PSDispatchBlip = {
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 name
sound2 = "GTAO_FM_Events_Soundset", -- Sound set
offset = false, -- Set to true to randomize exact location
flash = false -- Set to true to make blip flash
}When a parking meter robbery occurs, the following data is sent to ps-dispatch:
{
message = "Suspicious activity reported at a parking meter",
codeName = 'parkingmeter',
code = '10-31',
icon = 'fa-solid fa-parking',
priority = 2,
coords = vector3(x, y, z),
street = "Street Name, Zone",
heading = "North/South/East/West",
gender = "Male/Female/Unknown",
jobs = { 'leo' },
alert = Config.PSDispatchBlip
}PS-Dispatch uses the jobs table to determine which players receive the alert. By default, we use:
jobs = { 'leo' }This means all players with job.type == 'leo' will receive the alert. This is how ps-dispatch handles all police jobs (police, sheriff, state police, etc.).
Priority levels in ps-dispatch:
- 1 = High priority
- 2 = Medium priority (default for parking meter)
- 3 = Low priority
To change: Edit the priority value in client/alerts.lua
You can use any Font Awesome icon:
'fa-solid fa-parking'- Parking meter'fa-solid fa-money-bill'- Money'fa-solid fa-hand-holding-dollar'- Robbery'fa-solid fa-exclamation-triangle'- Warning
To change: Edit the icon value in client/alerts.lua
Edit Config.PSDispatchBlip in config.lua:
Blip Sprites (common ones):
- 161 = Standard dispatch marker
- 58 = Helicopter
- 56 = Police station
- 8 = Waypoint
Blip Colors:
- 1 = Red
- 2 = Green
- 3 = Blue
- 5 = Yellow
- 59 = Orange
To hide the exact location (making police search for it):
Config.PSDispatchBlip = {
offset = true, -- Enable random offset
-- ... other settings
}This will randomize the blip location within a small radius.
You can trigger a parking meter alert from other scripts:
-- Trigger from player's current location
exports['parking-meter-robbery']:ParkingMeterRobbery()
-- Trigger from custom location
local coords = vector3(x, y, z)
local streetName = "Main Street, Los Santos"
exports['parking-meter-robbery']:ParkingMeterRobberyCustom(coords, streetName)- Set minimum police to 0:
Config.MinimumPolice = 0- Give yourself a crowbar:
/giveitem [your ID] weapon_crowbar 1
-
Rob a parking meter
-
Check that:
- Alert appears in ps-dispatch UI
- Blip appears on map
- Sound plays (if not muted)
- Alert shows correct street name
-
Check ps-dispatch is running:
ensure ps-dispatch -
Verify job type:
- Your police job must have
type = 'leo'inqb-core/shared/jobs.lua - Example:
['police'] = { label = 'Law Enforcement', type = 'leo', -- This is required! -- ... }
- Your police job must have
-
Check on-duty status:
- Players must be on-duty to receive alerts (if Config.OnDutyOnly is enabled in ps-dispatch)
-
Enable debug mode:
Config.Debug = true
Check server console for "Sent ps-dispatch alert"
-
Check blip length:
- Make sure
Config.PSDispatchBlip.lengthis greater than 0
- Make sure
-
Check blip visibility:
- Some blip sprites may not be visible at certain scales
- Try changing sprite to 161 (standard marker)
-
Check if alerts are muted:
- Players can mute alerts in ps-dispatch UI
- Click the speaker icon to unmute
-
Verify sound files:
- Make sure ps-dispatch's sound files are installed
- Check
ps-dispatch/config.luafor InteractSound integration
The script uses native GTA functions to get street names. If the name is incorrect:
- This is a GTA limitation
- The game may not have proper street data for that location
- Consider using zones instead of exact street names
If you have security cameras, you can add camera data:
-- In client/alerts.lua, add to dispatchData:
camera = {
camId = cameraId,
coords = cameraCoords
}If the robbery involves a vehicle:
-- In client/alerts.lua, add to dispatchData:
vehicle = {
model = vehicleModel,
plate = vehiclePlate,
color = vehicleColor
}You can create different alert types for different scenarios:
-- For aggressive robberies
exports('ParkingMeterRobberyViolent', function()
-- Copy ParkingMeterRobbery function
-- Change priority to 1
-- Change message to include "violent"
end)For ps-dispatch specific issues:
- Check ps-dispatch documentation
- Verify ps-dispatch is up to date
- Test with ps-dispatch's default alerts first
For script issues:
- Enable Config.Debug
- Check server console
- Verify Config.DispatchSystem = 'ps-dispatch'