The Alert System is a comprehensive notification system designed for RedM, enabling dynamic alert creation when certain events occur, such as gunshots or custom events. It allows server administrators to configure alerts that trigger when specific criteria are met, and send real-time notifications to players in the vicinity.
- Gunshot Alerts: Automatically trigger alerts when shots are fired within a certain radius.
- Custom Alerts: Create custom alerts with configurable messages, distances, and targeted job roles.
- Blips for Alerts: Display map blips for both gunfire and custom alerts with configurable appearance settings.
- Cooldowns: Prevent repeated alerts in a short period by setting cooldown times between shots.
- Job-based Alerts: Control which player jobs receive alerts, such as police, sheriff, and others.
- Debug Mode: An optional debug mode to log additional information about alert generation and event triggering.
You can create your own custom alerts with unique messages, blip types, and target job roles. To do this, you need to define the blips in the config.lua file and then trigger the alerts using the CallSendCustomAlert function.
To add a custom blip type, define it in the Config.Blips table in the config.lua file. For example:
Config.Blips = {
-- Existing blip types...
robbery = {
sprite = 123456, -- Change with actual sprite ID
scale = 0.5,
label = "Robbery Alert",
modifier = `blip_robbery`,
color = 1,
areaSize = 10.0
},
emergency = {
sprite = 654321, -- Change with actual sprite ID
scale = 0.5,
label = "Emergency",
modifier = `blip_emergency`,
color = 1,
areaSize = 10.0
}
}- RSG-Core
- ox_lib
showcase.mp4
-
Clone the repository into your RedM resources folder.
git clone https://github.com/your-repo/af-alert.git