Skip to content
BRABO CustomsBRABO CUSTOMS

Vehicle config

Every vehicle that should work with the control panel needs its own configuration file. This file tells the script which extras map to which lighting functions, which siren preset to use, and which features are available.

File Location & Naming

Vehicle configs are placed in the configs/ folder inside the resource. Each file is named after the vehicle's spawn name:

configs/
├── politie1.config.lua
├── ambulance1.config.lua
├── brandweer1.config.lua
├── mughelikopter.config.lua
└── ...

The filename must exactly match the vehicle's spawn name (case-sensitive on Linux servers). Use lowercase to be safe.


Template

Use this template as a starting point for every new vehicle. Replace spawnnaam with your vehicle's actual spawn name.

local configData = {}
local spawnVoertuig = `spawnnaam`
if type(spawnVoertuig) ~= 'number' then
    spawnVoertuigB = GetHashKey(spawnVoertuig)
    spawnVoertuig = spawnVoertuigB
end

configData[spawnVoertuig] = {
    -- Lighting
    blauw = {},
    directLinks = {},
    directRechts = {},
    directCenter = {},
    steadyWhite = {},
    steadyWhiteLeft = {},
    steadyWhiteRight = {},
    steadyBlue = {},
    pitje = {},
    sf = {},

    -- Sirens
    sirene = 'hoog',
    Dualsirene = 'MPcall',
    Rumblesirene = 'rumble',

    -- Options
    muteSirenDuringHorn = 'true',
    excludeSiren = {'pitje'},

    -- Unique groups (mutually exclusive extras)
    unique = {
        directLinks = {},
        directRechts = {},
        directCenter = {},
    }
}

AddEventHandler('onClientResourceStart', function(resourceName)
    if (GetCurrentResourceName() == resourceName) then
        local respons = TriggerEvent("controlPanelV2:retrieveConfigs", configData, spawnVoertuig)
        Wait(1000)
        while respons == nil do
            respons = TriggerEvent("controlPanelV2:retrieveConfigs", configData, spawnVoertuig)
        end
    end
end)

Understanding Extras

Each lighting function is mapped to one or more vehicle extras. Extras are visual components defined in the vehicle's model (via ZModeler or similar tools) and numbered from 0 upward.

For example, if your vehicle has:

  • Extra 1 & 2 = front blue flashers
  • Extra 3 & 4 = rear blue flashers
  • Extra 5 = left arrow
  • Extra 6 = right arrow
  • Extra 7 = scene lights

Your config would look like:

configData[spawnVoertuig] = {
    blauw = {1, 2, 3, 4},
    directLinks = {5},
    directRechts = {6},
    steadyWhite = {7},
    sirene = 'hoog',
    excludeSiren = {},
}

Hiding UI Buttons

The control panel only shows buttons for features that exist in the config. To hide a button, simply omit the property entirely or do not include it in the config table.

For example, a basic patrol car without beacon, water sprays, or directional arrows:

configData[spawnVoertuig] = {
    blauw = {1, 2},
    steadyBlue = {3},
    sirene = 'hoog',
    excludeSiren = {},
}

Only the blue lights, cruise lights, and siren buttons will appear.

Setting a siren to 'geen' (Dutch for "none") also hides the siren button:

sirene = 'geen',  -- No siren, button hidden

Complete Property Reference

PropertyTypeDescription
blauw{int...}Extra IDs for blue emergency lights
directLinks{int...}Extra IDs for traffic adviser left
directRechts{int...}Extra IDs for traffic adviser right
directCenter{int...}Extra IDs for traffic adviser center
steadyWhite{int...}Extra IDs for work/scene lights
steadyWhiteLeft{int...}Extra IDs for left-side work lights
steadyWhiteRight{int...}Extra IDs for right-side work lights
steadyBlue{int...}Extra IDs for cruise/steady blue lights
pitje{int...}Extra IDs for the beacon
sf{int...}Extra IDs for sirene flashers (active only when siren is on)
sirenestringSiren preset name (see Siren Presets)
DualsirenestringDual siren (PowerCall) preset name
RumblesirenestringRumbler siren preset name
muteSirenDuringHornstring'true' to mute siren while horn is pressed
excludeSiren{string...}Light types that should not trigger native siren effect
uniquetableGroups of mutually exclusive extras (see Unique Extras)

Example Configs

Police Patrol Car

configData[spawnVoertuig] = {
    blauw = {1, 2, 3},
    directLinks = {4},
    directRechts = {5},
    directCenter = {6},
    steadyBlue = {7},
    steadyWhite = {8},
    sirene = 'hoog',
    Dualsirene = 'MPcall',
    Rumblesirene = 'rumble',
    excludeSiren = {'steadyBlue', 'steadyWhite'},
    unique = {
        directLinks = {4},
        directRechts = {5},
        directCenter = {6},
    }
}

Ambulance

configData[spawnVoertuig] = {
    blauw = {1, 2},
    steadyWhite = {3},
    steadyWhiteLeft = {4},
    steadyWhiteRight = {5},
    sirene = 'ambulance',
    Dualsirene = 'Pcall',
    muteSirenDuringHorn = 'true',
    excludeSiren = {'steadyWhite', 'steadyWhiteLeft', 'steadyWhiteRight'},
}

Fire Truck

configData[spawnVoertuig] = {
    blauw = {1, 2, 3},
    steadyWhite = {4},
    pitje = {5},
    sf = {6},
    sirene = 'bwbig',
    Dualsirene = 'BPcall',
    excludeSiren = {'pitje', 'steadyWhite'},
}