Kartik Scripts

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

ParameterTypeDescription
disablebooleantrue = 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)

On this page