Air Raid Sirens
The air raid sirens provides you the ability to alert the nation with the press of a button. Configure multiple siren(s) (areas) and browse through the list before powering the sirens.
Overview
Section titled “Overview”Air Raid Sirens is an emergency alert system that allows server administrators to trigger air raid sirens across specific areas or the entire map. Perfect for emergency situations, roleplay scenarios, or creating atmospheric events on your FiveM server.
Key Features
Section titled “Key Features”- ✅ Multi-source 3D spatial audio system - Realistic directional sound
- ✅ Modern keybinding system - Customizable controls
- ✅ Smooth fade-in/fade-out transitions - Professional audio experience
- ✅ Real-time 3D audio with head-tracking - Immersive sound positioning
- ✅ Per-area sound configuration - Individual area audio settings
- ✅ Area-Based Control - Target specific areas or zones with additive activation
- ✅ In-Game Siren Editor - Place, move, rename and delete sirens and areas from the control panel
- ✅ Sirens Stored in
sirens.json- The server reads and writes the file itself - ✅ Volume & Sound Configuration - Customize audio settings
- ✅ Range Settings - Configure siren coverage area
- ✅ Multiple Siren Sounds - Support for various siren sound files
- ✅ Custom UI - User-friendly interface design
- ✅ OneSync Compatible - Works with Legacy and Infinity
- ✅ 3D Siren Objects - Custom air raid siren 3D models
- ✅ Editable CSS - Customize the visual appearance
- ✅ Multi-Framework Support - ESX/QBCore/Discord API permissions
- ✅ Multi-Language Support - International server support
- ✅ Advanced Export System - Comprehensive API for other resources
- ✅ Escrow Protection - Secure resource protection
- 📊 Performance: 0.00-0.02ms - Optimized for minimal impact
Installation Tutorial
Section titled “Installation Tutorial”Follow our step-by-step installation guide:
Important Pre-Installation Notes
Section titled “Important Pre-Installation Notes”System Requirements & Compatibility
Section titled “System Requirements & Compatibility”OneSync Compatibility
Section titled “OneSync Compatibility”- OneSync Legacy: Fully tested and compatible
- OneSync Infinity: Fully tested and compatible
Framework Compatibility
Section titled “Framework Compatibility”- ESX: Full compatibility with ESX framework
- QBCore: Full compatibility with QBCore framework
- Discord API: Compatible with Discord API integration
- Standalone: Works without any framework
Installation Process
Section titled “Installation Process”Step 1: Download the Resource
Section titled “Step 1: Download the Resource”- Access CFX Portal
- Go to CFX Portal Assets
- Find “Air Raid Sirens” in your granted assets
- Download the ZIP package
Step 2: Extract and Transfer
Section titled “Step 2: Extract and Transfer”-
Extract the ZIP file
- Unpack the downloaded ZIP package to a local folder
- Ensure all files are properly extracted
-
Transfer to Server
- Set your FTP client to binary transfer mode
- Upload the
night_air_raid_sirensfolder to your server’sresourcesdirectory - Maintain the original folder structure
Step 3: Server Configuration
Section titled “Step 3: Server Configuration”Add the following line to your server.cfg file:
ensure night_air_raid_sirensStep 4: Configuration Setup
Section titled “Step 4: Configuration Setup”-
Navigate to Config File
- Open
night_air_raid_sirens/config/config.lua - Review all configuration options
- Open
-
Configure Settings
- Set up volume and sound settings
- Configure range and coverage areas
- Adjust permissions and access controls
How It Works
Section titled “How It Works”Siren System
Section titled “Siren System”- Area-Based Control: Target specific areas or zones for siren activation
- Multiple Sirens: Configure various siren sound files
- Range Control: Set coverage area for siren alerts
- Volume Management: Adjust audio levels for different situations
- 3D Objects: Custom air raid siren models in the world
- Selective Activation: Choose which areas to activate or deactivate
User Interface
Section titled “User Interface”- Area Selection: Choose specific areas to activate sirens
- Siren Selection: Browse through available siren sounds
- Easy Activation: Simple button press to trigger sirens
- Status Display: Visual indicators for active sirens and areas
- Custom Styling: Editable CSS for UI customization
Emergency Alerts
Section titled “Emergency Alerts”- Instant Activation: Trigger sirens immediately when needed
- Targeted Coverage: Alert specific areas or entire server population
- Roleplay Integration: Perfect for emergency scenarios
- Atmospheric Events: Create immersive server experiences
- Selective Control: Activate or deactivate specific areas as needed
Commands
Section titled “Commands”| Command | What it does | Who can use it |
|---|---|---|
/arsmenu |
Opens the control panel | Players with permission |
/togglears |
Mutes or unmutes the sirens for yourself, without affecting others | Everyone |
/drawcoverage |
Draws the sound reach of every placed siren, to test your coverage | Players with permission |
/arsreload |
Reads sirens.json again after you edited it by hand |
Players with editor permission |
The command names are set under Controls in config/config.lua. No key is bound by default. Players bind their own keys in game under Settings → Key Bindings → FiveM, or you set a default with keyMapping:
Controls = { ToggleSirens = { command = "togglears", keyMapping = '', -- Empty = no default key input = 'keyboard' }, OpenARSMenu = { command = "arsmenu", keyMapping = '', input = 'keyboard' },},Permissions
Section titled “Permissions”These settings decide who may open the control panel and trigger sirens:
EveryoneHasPermission = true,
Enable_Night_DiscordApi_Permissions = false,Enable_Ace_Permissions = false,Enable_ESX_Permissions = false,Enable_QBCore_Permissions = { Check_By_Job = false, Check_By_Permissions = false,},
PermissionRoles = { "Admin", "police", "Administrator",},Set EveryoneHasPermission to false, turn on the systems you use, and write your Discord role names, ESX jobs, ACE names or QBCore jobs and groups in PermissionRoles. A player needs one of them.
See ACE Permissions and Discord API for the setup of those two systems.
Siren Editor
Section titled “Siren Editor”Players with editor permission see two tabs in the control panel: Control and Editor. In the Editor you manage areas and sirens in game. Every change is saved to sirens.json and reaches all players at once.
- Create an area by typing its name, and delete an area.
- Set an area’s name, sound, range, volume and whether it is enabled, then press Save area.
Sirens
Section titled “Sirens”- Place siren adds a siren where you aim. At my position adds one where you stand.
- Per siren you can set a name and a sound of its own, move it to another area, move it to a new spot, teleport to it or delete it. The name is used for the siren’s map blip. A siren without a sound of its own plays the area’s sound.
- A siren’s sound is saved when you pick it, and its name when you press Enter or leave the field.
- Deleting asks for a second click.
Placing a Siren
Section titled “Placing a Siren”Placing closes the panel and shows a see-through siren where you aim, up to 75 metres away. A small window shows the controls, the area and the heading. The panel opens again afterwards.
| Control | Action |
|---|---|
| Left mouse button | Place |
| Mouse wheel | Rotate |
| Shift + mouse wheel | Rotate in steps of 1 degree |
| Right mouse button or Esc | Cancel |
Aim at the ground to place. Weapons and the pause menu are blocked while you place.
Who May Edit
Section titled “Who May Edit”The editor has its own roles, so not everyone who may trigger sirens can change them. It uses the permission systems you turned on under Permissions.
Editor = { EveryoneHasPermission = false, PermissionRoles = { "Manager", "Admin", "Administrator", }, MaxNameLength = 50, -- Max characters for area and siren names MaxSoundReach = 5000.0, -- Max sound reach (meters) that can be set in-game MaxSoundVolume = 0.5, -- Max volume that can be set in-game},Siren Storage
Section titled “Siren Storage”Areas and sirens are stored in sirens.json in the resource folder. The server reads and writes this file itself, so the resource folder must be writable by the server.
- First start: when
sirens.jsondoes not exist, it is created fromSirenObjectLocationsinconfig/config.lua. - After that:
sirens.jsonis the only source. Changes toSirenObjectLocationshave no effect. - Start over: delete
sirens.jsonto create it fromSirenObjectLocationsagain. This discards the changes made in game.
{ "version": 1, "areas": { "Area Name": { "soundFile": "air-raid-siren", "soundReach": 1250.0, "soundVolume": 0.1, "enabled": true, "poles": [ { "name": "Town Hall", "soundFile": "luchtsirene", "x": 100.0, "y": 200.0, "z": 30.0, "heading": 0.0 }, { "x": 150.0, "y": 250.0, "z": 30.0, "heading": 90.0 } ] } }}name and soundFile on a siren are optional.
Sounds
Section titled “Sounds”Your Own Siren Sound
Section titled “Your Own Siren Sound”- Put your
.oggfile inNUI/sounds/. - Add it to
SirenSoundFileListinconfig/config.lua:
SirenSoundFileList = { [1] = {SoundFile = "air-raid-siren", DisplayName = "Default Air Raid Sirens"}, [2] = {SoundFile = "luchtsirene", DisplayName = "Dutch Air Raid Sirens"}, [3] = {SoundFile = "your-sound", DisplayName = "Your Custom Siren"},},SoundFile is the file name without .ogg.
Sound Settings
Section titled “Sound Settings”| Setting | What it does |
|---|---|
SirenSoundVolume |
The siren volume, 0.10 by default. Above 0.5 is not recommended |
AudioListener.Orientation |
"camera": left and right follow where you look. "character": they follow where your character faces |
AudioListener.Position |
"character": distance is measured from your character. "camera": from the camera |
OutOfRangeInterval |
How often, in seconds, the script checks whether you are in range of a siren |
Export Functions
Section titled “Export Functions”Legacy Exports (Backward Compatibility)
Section titled “Legacy Exports (Backward Compatibility)”These exports maintain compatibility with older scripts and documentation:
Toggle Sirens (Legacy)
Section titled “Toggle Sirens (Legacy)”-- Toggle sirens automatically (on when off, off when on)exports['night_air_raid_sirens']:TriggerAirRaidSirens(soundFile, targetAreas, targetSirens)
-- Example usageexports['night_air_raid_sirens']:TriggerAirRaidSirens("air-raid-siren")Force Siren State (Legacy)
Section titled “Force Siren State (Legacy)”-- Force sirens on or offexports['night_air_raid_sirens']:ToggleAirRaidSirens(soundFile, onOrOff, targetAreas, targetSirens)
-- Example usageexports['night_air_raid_sirens']:ToggleAirRaidSirens("air-raid-siren", true) -- Turn onexports['night_air_raid_sirens']:ToggleAirRaidSirens("air-raid-siren", false) -- Turn offNew Exports (Recommended)
Section titled “New Exports (Recommended)”Modern area-based control with better functionality:
Activate Areas
Section titled “Activate Areas”-- Activate specific areas (additive - adds to existing active areas)-- soundFile: a sound file name, or nil to let every area play its own sound-- areaNames: the area names as they are in sirens.jsonexports['night_air_raid_sirens']:TriggerAirRaidSirensByAreaExport(soundFile, areaNames)
-- Example usageexports['night_air_raid_sirens']:TriggerAirRaidSirensByAreaExport("air-raid-siren", {"Fort Zancudo", "Grapeseed"})Deactivate Areas
Section titled “Deactivate Areas”-- Deactivate specific areas (subtractive - removes only specified areas)exports['night_air_raid_sirens']:DeactivateAirRaidSirensByAreaExport(areaNames)
-- Example usageexports['night_air_raid_sirens']:DeactivateAirRaidSirensByAreaExport({"Fort Zancudo"})Deactivate All Sirens
Section titled “Deactivate All Sirens”-- Turn off all sirens completelyexports['night_air_raid_sirens']:DeactivateAllAirRaidSirensExport()
-- Example usageexports['night_air_raid_sirens']:DeactivateAllAirRaidSirensExport()Utility Exports (Read-only Information)
Section titled “Utility Exports (Read-only Information)”Get Available Areas
Section titled “Get Available Areas”-- Returns array of all configured areas with their settingslocal areas = exports['night_air_raid_sirens']:GetAvailableAreas()
-- Returns: table with {name, poleCount, soundFile, soundReach, soundVolume, enabled}Get Sirens in Area
Section titled “Get Sirens in Area”-- Returns configuration data for a specific arealocal areaData = exports['night_air_raid_sirens']:GetSirensInArea(areaName)
-- Example usagelocal areaData = exports['night_air_raid_sirens']:GetSirensInArea("Fort Zancudo")
-- Returns: table with {soundFile, soundReach, soundVolume, enabled, poleCount, poles, poleDetails}Get Zone For Coords
Section titled “Get Zone For Coords”Resolves which siren zone(s) cover a given world position. Designed for lightweight server-side polling from external resources, such as triggering zone-specific sirens based on a tornado or disaster location.
-- Returns the closest zone and all zones whose coverage radius includes the given positionlocal closestZone, zonesInRange, closestDistance = exports['night_air_raid_sirens']:GetZoneForCoords(x, y, z, maxDistance)
-- Parameters:-- x, y, z (number) : world position to test-- maxDistance (number) : optional cap on detection radius (defaults to each area's soundReach)
-- Returns:-- closestZone (string) : area name with the nearest pole, regardless of distance-- zonesInRange (table) : all area names where the position falls within coverage radius-- closestDistance (number) : distance in metres to the nearest poleBasic example — activate sirens for the zone a tornado is in:
-- Server-side, called from your storm/tornado resourcelocal tornadoCoords = GetTornadoPosition() -- your own function
local closestZone, zonesInRange = exports['night_air_raid_sirens']:GetZoneForCoords( tornadoCoords.x, tornadoCoords.y, tornadoCoords.z)
if #zonesInRange > 0 then exports['night_air_raid_sirens']:TriggerAirRaidSirensByAreaExport("air-raid-siren", zonesInRange)else exports['night_air_raid_sirens']:DeactivateAllAirRaidSirensExport()endPolling example — update sirens as a tornado moves:
-- Server-side polling loop (run inside a Citizen.CreateThread)Citizen.CreateThread(function() while tornadoActive do Citizen.Wait(5000) -- poll every 5 seconds
local coords = GetTornadoCurrentCoords() local _, zonesInRange = exports['night_air_raid_sirens']:GetZoneForCoords( coords.x, coords.y, coords.z )
if zonesInRange and #zonesInRange > 0 then exports['night_air_raid_sirens']:TriggerAirRaidSirensByAreaExport("air-raid-siren", zonesInRange) else exports['night_air_raid_sirens']:DeactivateAllAirRaidSirensExport() end endend)Editing Export (Server Side)
Section titled “Editing Export (Server Side)”Edit Sirens
Section titled “Edit Sirens”EditSirens does from another resource what the Siren Editor does in game: it creates, changes and deletes areas and sirens. The change is checked, saved to sirens.json and sent to all players at once. It is a server export and has no permission check, so the calling resource decides who may use it.
local ok, message, result = exports['night_air_raid_sirens']:EditSirens(action, payload)
-- ok (boolean) : true when the change was saved-- message (string) : the text the in-game editor would show, also when ok is false-- result (table) : what the action returns, see the table below| Action | Payload | Result |
|---|---|---|
createArea |
{ name, soundFile?, soundReach?, soundVolume?, enabled? } |
{ area } |
updateArea |
{ area, name?, soundFile?, soundReach?, soundVolume?, enabled? } |
{ area } |
deleteArea |
{ area } |
|
addPole |
{ area, x, y, z, heading?, name?, soundFile? } |
{ id } |
updatePole |
{ id, area?, x?, y?, z?, heading?, name?, soundFile? } |
{ id } |
deletePole |
{ id } |
A field with ? is optional. In an update, only the fields you send are changed.
areais the area’s current name. InupdateArea,namerenames the area. InupdatePole,areamoves the siren to that area.soundFilemust be one ofSirenSoundFileListinconfig/config.lua. On a siren,""clears its own sound, so it plays the area’s sound again.name = ""clears a siren’s name.soundReachis 1 toEditor.MaxSoundReachmetres andsoundVolumeis 0 toEditor.MaxSoundVolume. A new area starts with the first sound of the list, a reach of 1250 metres andSirenSoundVolume.- Names are 1 to
Editor.MaxNameLengthcharacters. - Disabling an area that is sounding turns it off.
idis the siren’s number. Read it frompoleDetailsof Get Sirens in Area, or keep the oneaddPolereturns. The numbers are given out again when the resource starts or/arsreloadruns, so read them fresh before you use them.
When a value is refused or sirens.json cannot be written, nothing changes and ok is false.
-- Server-side: an area with one siren, moved later, then removedlocal ok, message, result = exports['night_air_raid_sirens']:EditSirens("createArea", { name = "Harbour", soundFile = "air-raid-siren", soundReach = 800.0,})if not ok then return print(message) end
local _, _, pole = exports['night_air_raid_sirens']:EditSirens("addPole", { area = "Harbour", x = 1200.0, y = -3000.0, z = 6.0, heading = 90.0, name = "Dock 4",})
exports['night_air_raid_sirens']:EditSirens("updatePole", { id = pole.id, x = 1210.0, y = -3010.0 })exports['night_air_raid_sirens']:EditSirens("deleteArea", { area = "Harbour" })poleDetails holds one entry per siren, in the same order as poles:
local areaData = exports['night_air_raid_sirens']:GetSirensInArea("Fort Zancudo")
for i, details in ipairs(areaData.poleDetails) do -- details.id, details.name, details.soundFile; areaData.poles[i] is the position (vector4)endSound File Examples
Section titled “Sound File Examples”Default sound file names you can use:
"air-raid-siren""luchtsirene"
Area Name Examples
Section titled “Area Name Examples”Default area names you can use:
"Fort Zancudo""Grapeseed""Sandy Shores""Paleto Bay"
Customization
Section titled “Customization”CSS Editing
Section titled “CSS Editing”The Air Raid Sirens includes limited editable CSS files allowing you to:
- Customize UI appearance to match your server theme
- Modify colors and styling for better visual integration
3D Object Customization
Section titled “3D Object Customization”- Custom siren models for visual representation
- Placement options for strategic siren locations
Integration & Compatibility
Section titled “Integration & Compatibility”Framework Integration
Section titled “Framework Integration”- ESX Integration: Compatible with ESX job systems and permissions
- QBCore Integration: Compatible with QBCore permissions and groups
- Discord API: Integrate with Discord role-based permissions
- Standalone Operation: Works without any framework
Emergency Systems Examples
Section titled “Emergency Systems Examples”- Police Integration: Perfect for law enforcement scenarios
- Emergency Services: Ideal for medical and fire department roleplay
- Military Operations: Great for military and defense scenarios
- Civil Defense: Excellent for disaster and emergency situations
Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”Sirens Not Working
Section titled “Sirens Not Working”Audio Issues
Section titled “Audio Issues”Permission Issues
Section titled “Permission Issues”Error Messages
Section titled “Error Messages”| Error | Solution |
|---|---|
| “Resource not found” | Check resource folder name and ensure line |
| “Sound file not found” | Verify sound file exists in resource |
| “Permission denied” | Check configuration permissions |
| “Export failed” | Verify export function syntax |
Best Practices
Section titled “Best Practices”Configuration Best Practices
Section titled “Configuration Best Practices”- Start with default settings and adjust based on server needs
- Test different sound files to find the best fit
- Set appropriate permissions to prevent abuse
- Configure range settings adjust to your desires
Emergency Planning
Section titled “Emergency Planning”- Establish protocols for when to use sirens
- Train staff on proper siren activation
- Coordinate with other emergency systems
- Test sirens regularly to ensure functionality
Roleplay Integration
Section titled “Roleplay Integration”- Create emergency scenarios that utilize sirens
- Integrate with police and emergency services
- Use for atmospheric events and server announcements
- Coordinate with other roleplay systems
Support
Section titled “Support”Getting Help
Section titled “Getting Help”If you’re having trouble with Air Raid Sirens:
- Review this documentation thoroughly
- Check server console for error messages
- Verify your configuration matches the examples
- Join our Discord for community support
Community Support
Section titled “Community Support”Join our Discord community for:
- Technical support
- Configuration help
- Best practices sharing
- Community discussions