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
└── ...
circle-exclamation

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:


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:

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

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


Complete Property Reference

Property
Type
Description

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)

sirene

string

Siren preset name (see Siren Presets)

Dualsirene

string

Dual siren (PowerCall) preset name

Rumblesirene

string

Rumbler siren preset name

muteSirenDuringHorn

string

'true' to mute siren while horn is pressed

excludeSiren

{string...}

Light types that should not trigger native siren effect

unique

table

Groups of mutually exclusive extras (see Unique Extrasarrow-up-right)

waterSprays

{int...}

Presence enables the water spray button

syncGroup

string

Sync group name for flash pattern synchronization


Example Configs

Police Patrol Car

Ambulance

Fire Truck