disableAlerts
*
๐จ Disable Alerts
Description
Temporarily disables or re-enables dispatch alerts for the player.
Useful when entering specific zones (e.g., police stations, garages, safe zones) where dispatch notifications should not be triggered.
โ Usage
-- Disable alerts
disableAlerts(true)
-- Enable alerts again
disableAlerts(false)๐ Parameters
| Parameter | Type | Description |
|---|---|---|
disable | boolean | true = Disable dispatch alerts (entering a no-dispatch zone). false = Enable alerts again (leaving the zone). |
๐ก Example
Disable alerts while inside a no-dispatch zone:
AddEventHandler("onPlayerEnterZone", function(zoneName)
if zoneName == "police_station" then
disableAlerts(true)
end
end)
AddEventHandler("onPlayerExitZone", function(zoneName)
if zoneName == "police_station" then
disableAlerts(false)
end
end)