cfx-noisiak-lightbars - Documentation

 

1️⃣Requirements

DependencyNotes
ox_libRequired - used for localization, zones, keybinds, notifications, model loading
FrameworkOne of: ox_core, es_extended, qb-core, qbx_core - or none (custom bridge)
Renewed SirenSyncRecommended - improves siren synchronization and stability
Luxart Vehicle ControlOptional - only if you use Luxart siren sync

The script auto-detects your framework on startup - no manual setup required.

2️⃣ Installation

  1. Drop the noisiak-lightbars folder into your resources/ directory
  2. Add to server.cfg (after ox_lib and framework):
ensure noisiak-lightbars
 
  1. Configure:
    • configs/config-shared.lua
    • configs/config-vehicles.lua
  2. Restart the resource or reboot the server

 

3️⃣ fxmanifest.lua - What to Uncomment

🔊 Luxart Siren Sync

If you are using Luxart Vehicle Control, uncomment:

'modules/bridge-sync/luxart/client.lua', -- UNCOMMENT THIS LINE
 

Without this → native state bags are used
With Luxart → script syncs using IsVehicleSirenOn()

 

4️⃣ Configuration - config-shared.lua

All core settings are located in:

configs/config-shared.lua
 

 

👮 Job / Permission Check

Config.Shared.CheckJob = false
 
ValueBehavior
falseAnyone in supported vehicle can open menu
trueRequires job defined in config
 
Config.Shared.Jobs = {
    ['police']   = true,
    ['mechanic'] = true,
    -- ['ambulance'] = 3
}
 

➡️ true = any grade
➡️ number = minimum required grade

 

🎮 Menu Open Method

Config.Shared.OpenMethod = 'command'
 
ValueDescription
command/lightbars
keybindKey (default F7)
radialox_lib radial menu
niluse export only
Config.Shared.OpenMethodCommand = 'lightbars'
Config.Shared.OpenMethodKeybind = 'F7'
 

 

📍 Zone Restriction

Config.Shared.AccessOnlyInZone = true
 

If enabled → menu works only inside defined zones.

Config.Shared.Zones = {
    {
        name      = "mr_pd",
        thickness = 4.0,
        points    = {
            vec3(428.0, -1013.0, 29.0),
            vec3(426.86, -1031.0, 29.0),
            vec3(459.07, -1026.43, 29.0),
            vec3(456.10, -1011.94, 29.0),
        },
    },
}
 

Keybind & radial menu auto-disable outside zones

 

5️⃣ Framework Bridges

Framework is detected automatically.

Supported Frameworks

FrameworkResourceNotes
Ox Coreox_corerequires >= 0.21.3
ESXes_extendeduses job + grade
QBCoreqb-corejob + gang + grade
QBXqbx_coregroup system
Custom-see below

 

🔧 Internal Format

PlayerData.groups = {
    ['police'] = 2,
    ['ballas'] = 0,
}
 

 

6️⃣ Custom Bridge

Used if no framework is detected.

 

📡 Client Events

TriggerClientEvent('noisiak-lightbars:bridge:setGroups', source, {['police'] = 2,})

TriggerClientEvent('noisiak-lightbars:bridge:setGroup', source, 'police', 3)

TriggerClientEvent('noisiak-lightbars:bridge:logout', source)
 

 

🖥️ Server Events

TriggerNetEvent('noisiak-lightbars:bridge:setGroups', source, {['police'] = 2,})

TriggerNetEvent('noisiak-lightbars:bridge:setGroup', source, 'police', 3)

TriggerNetEvent('noisiak-lightbars:bridge:logout', source)
 

 

🧩 Example Implementation

AddEventHandler('myFramework:playerLoaded', function(source, playerData)
    local groups = {
        [playerData.job] = playerData.jobGrade,
    }

    TriggerClientEvent('noisiak-lightbars:bridge:setGroups', source, groups)
    TriggerNetEvent('noisiak-lightbars:bridge:setGroups', source, groups)
end)
 

 

7️⃣ Exports (API)

🎯 Client

exports['noisiak-lightbars']:OpenMenu()
exports['noisiak-lightbars']:setLightbar(index, ignoreChecks)

local ok, reason = exports['noisiak-lightbars']:CanMakeAction()
 

 

Example

RegisterCommand('policelightbar', function()
    exports['noisiak-lightbars']:OpenMenu()
end)
 
exports['noisiak-lightbars']:setLightbar(1, true)
 

 

8️⃣ Translations

  • Located in locales/
  • Included:
    • en.json
    • pl.json

Auto-selected via ox_lib

 

➕ Add New Language

  1. Copy:
 
locales/en.json
 
  1. Rename:
 
locales/de.json
 
  1. Translate values

 

fxmanifest.lua

 
files {
    'locales/*.json'
}