Alerts
Details
Below, you will find detailed configuration for alerts.
Configuration file
return {
---@type table<string, PredefinedBlip>
predefinedBlips = {
['shooting'] = {
sprite = 110,
color = 1,
scale = 1.2,
time = 15 * 1000
},
['vehicle_shooting'] = {
sprite = 110,
color = 1,
scale = 1.2,
time = 15 * 1000
},
['fighting'] = {
sprite = 110,
color = 1,
scale = 1.2,
time = 15 * 1000
}
},
---@type number
defaultBlipTime = 10 * 1000,
---@type boolean
slowlyDecreaseBlipOpacity = true,
---@type boolean
enable911Commands = true,
---@type number
cooldownFor911 = 30, -- seconds
---@type suppressShootingConfig
suppressShooting = {
enabled = true,
delay = 5, -- seconds
radius = 50,
cleanup = 5, -- seconds
},
---@type ShootingBlacklist
blacklist = {
jobs = {},
weapons = {}
}
}Predefined Blips
Predefined blips mean, that you are able to predefine a blip configuration and later to reuse it in string form everywhere. For example, you define blip configuration with shooting key, and later simply use it in alert.
This will simplify your alert creation in general, since if you decide to change blip, you’ll only need to change it only in one place
Payload type
---@class PredefinedBlip
---@field sprite? number
---@field color number
---@field scale number
---@field radius? number
---@field flashes? boolean
---@field time? number Detailed types information
sprite number You can choose a sprite from Fivem Documentation
color number Blip color. Choose from Fivem Documentation
scale number Blip scale. Usually from 0.1 to 1.0
radius number If radius is set, sprite will be ignored and location randomised inside the radius.
flashes boolean Defines if blip flashes.
time number Defines for how long blip will be visible. In miliseconds.
Other definitions
defaultBlipTime number This defines default blip visibility time. In miliseconds.
slowlyDecreaseBlipOpacity boolean If enabled, blip will slowly loose opacity.
enable911Commands boolean Defines if 911 commands are enabled.
cooldownFor911 number Defines 911 command cooldown before new alert is made. If player has active alert, messages are going to be sent to the same alert.
Shooting suppression
We’ve implemented somewhat complicated system, which will suppress shots and update only shots fired in below defined radius.
Payload type
---@class suppressShootingConfig
---@field enabled boolean
---@field delay number
---@field radius number
---@field cleanup number Detailed types information
enabled boolean Defines if shooting will be suppressed.
delay number Defines shooting delay, which means how long from the first shot, shots will be counted and update on the same alert.
radius number Defines radius, where shoots gonna be suppressed and counted. Radius will be counted from the first shots fired coordinates.
cleanup number Defines a timer, when old logged coordinates will be cleaned up.
Shooting blacklist
Payload type
---@class ShootingBlacklist
---@field jobs table<string>
---@field weapons table<string> Detailed types information
jobs string[] If job is added to this array, shots will be ignored.
weapons string[] if weapon is added to this array, shots will be ignored from it.