Police Alerts
When police are alerted about clamps, and how to connect your dispatch resource.
#When an Alert Goes Out
| Alert | Trigger | Default Chance |
|---|---|---|
lockpick | An NPC sees someone lockpicking a clamp. | 60% |
grind | An NPC sees someone cutting a clamp off. Uses zyke_anglegrinder's own witness checks and settings. | 80% |
alarm | A windscreen clamp's alarm goes off: the vehicle moved (moved), the keypad locked after too many wrong codes (tamper), or the windscreen is being smashed (smash). No witness needed. | 100% |
Lockpick witnesses are peds on foot within witnesses.maxDistance (30 metres) and inside their fieldOfView, or drivers inside vehicleFieldOfView. The check repeats every recheckInterval during the attempt. Set witnesses.enabled = false to alert on every lockpick attempt without a witness.
Each alert waits a random delay (5 to 10 seconds) before it reaches the police. The same vehicle can't raise the same alert again for cooldownSeconds (120 seconds). Set an alert's chance to 0 to turn it off, or policeAlert.enabled = false to turn off all of them.
#Built-In Alert
Players on policeAlert.jobs (on-duty police by default) get a notification and a radius blip over the area for 60 seconds. Restyle the blip and notification in client/unlocked/police_alert.lua.
#Using Your Own Dispatch
Every alert that goes out runs OnWheelclampAlert in server/unlocked/police_alert.lua, after the chance, delay and cooldown. Call your dispatch resource there with data.coords and data.plate, and remove sendBuiltInAlert if your dispatch replaces the blip.
Example:
lua---@param data WheelclampAlertData function OnWheelclampAlert(data) -- data.type: "lockpick", "grind" or "alarm" -- data.reason: "moved", "tamper" or "smash" for alarms -- data.source: the player behind it, when known sendBuiltInAlert(data) end
Other resources can listen to the zyke_wheelclamp:OnPoliceAlert server event instead. See Exports & Events.