Zum Inhalt springen
BRABO CustomsBRABO CUSTOMS

Settings

ControlPanel V3 has two layers of settings: server-wide defaults defined in the config file and per-player preferences that individual players can change through the in-game settings panel.


Server-Wide Settings

These settings are defined in shared/config.lua under Config.Settings and apply as defaults for all players on the server.

Config.Settings = {
    switchWithHornKey = true,
    switchAmbulanceWithoutHorn = true,
    defaultLanguage = "NL",
    stopSirenOutsideVeh = false,
    toggleButtonSoundEnabled = true,
    toggleIndicatorSoundEnabled = true,
    toggleButtonSoundSrc = "button",
    beaconAnimationEnabled = true,

    muteHornOnSirenSwitchPresets = {
        "^ambulance",
        "^spooky$",
        "^asimex$",
        "^mug$",
        "^motor$",
        "^micu$",
        "^vama$"
    },

    excludeFromHornKeySwitchPresets = {
        "^bw",
        "^crashtender$",
        "^EQ2B$"
    }
}

Setting Reference

SettingTypeDefaultDescription
switchWithHornKeybooleantrueEnables switching between siren tones by quickly pressing the horn key. Holding the horn key still plays the vehicle horn. Presets listed in excludeFromHornKeySwitchPresets are excluded from this behaviour.
switchAmbulanceWithoutHornbooleantrueAllows configured siren presets to switch tones through the horn key without playing an audible horn sound. The affected presets are configured in muteHornOnSirenSwitchPresets.
defaultLanguagestring"NL"Defines the default language used by the control panel UI.
stopSirenOutsideVehbooleanfalseAutomatically stops the active siren when the player exits the vehicle.
toggleButtonSoundEnabledbooleantrueEnables the click sound played when toggling buttons in the control panel.
toggleIndicatorSoundEnabledbooleantrueEnables the sound played when toggling vehicle indicators.
toggleButtonSoundSrcstring"button"Defines the audio source used for control panel button click sounds.
beaconAnimationEnabledbooleantrueEnables the hand animation used when toggling supported beacon lights.
muteHornOnSirenSwitchPresetstableSee configDefines which siren presets can switch tones through the horn key without playing an audible horn. This list is only used when switchAmbulanceWithoutHorn is enabled.
excludeFromHornKeySwitchPresetstableSee configDefines which siren presets are excluded from horn-key siren switching. This list is only used when switchWithHornKey is enabled.

Siren Preset Matching

The values in muteHornOnSirenSwitchPresets and excludeFromHornKeySwitchPresets are Lua patterns. These patterns are matched against the configured siren preset name.

Pattern Reference

PatternBehaviour
^nameMatches every preset name that starts with name.
name$Matches every preset name that ends with name.
^name$Matches only the exact preset name name.

For example:

"^ambulance"

Matches presets such as:

ambulance
ambulance2
ambulance7

The following pattern:

"^spooky$"

Only matches the exact preset name:

spooky

Presets Without an Audible Horn

The following presets switch siren tones through the horn key without playing an audible horn when switchAmbulanceWithoutHorn is enabled:

muteHornOnSirenSwitchPresets = {
    "^ambulance",
    "^spooky$",
    "^asimex$",
    "^mug$",
    "^motor$",
    "^micu$",
    "^vama$"
}
PatternMatching presets
^ambulanceAny preset starting with ambulance, such as ambulance, ambulance2, or ambulance7.
^spooky$Only the exact preset spooky.
^asimex$Only the exact preset asimex.
^mug$Only the exact preset mug.
^motor$Only the exact preset motor.
^micu$Only the exact preset micu.
^vama$Only the exact preset vama.

muteHornOnSirenSwitchPresets is only applied when switchAmbulanceWithoutHorn is set to true.

Presets Excluded From Horn-Key Switching

The following presets cannot switch siren tones through the horn key when switchWithHornKey is enabled:

excludeFromHornKeySwitchPresets = {
    "^bw",
    "^crashtender$",
    "^EQ2B$"
}
PatternMatching presets
^bwAny preset starting with bw, such as bw, bw2, bwbig, or bwsmall.
^crashtender$Only the exact preset crashtender.
^EQ2B$Only the exact preset EQ2B.

Lua pattern matching is case-sensitive. For example, ^EQ2B$ matches EQ2B, but it does not match eq2b.


Per-Player Settings

Several settings can be overridden by individual players through the in-game settings panel, which can be opened using:

/cp-settings

These preferences are stored locally on the player's machine using FiveM's KVP system and persist across sessions.

Player-Adjustable Settings

SettingDescriptionStored As
Button soundEnables or disables control panel button click sounds.button_sound KVP
Button sound sourceSelects which button click sound is used.button_sound_src KVP
Indicator soundEnables or disables indicator toggle sounds.indicator_sound KVP
Stop siren outside vehicleEnables or disables automatic siren stopping on exit.stopSirenOutsideVeh KVP
UI themeSelects the visual theme used by the control panel.ui_theme KVP

Per-player settings override the corresponding server defaults. For example, when toggleButtonSoundEnabled is enabled in the server configuration but a player disables button sounds in the settings panel, button sounds will remain disabled for that player.

The following settings are controlled exclusively through the server configuration and cannot be overridden through the player settings panel:

  • switchWithHornKey
  • switchAmbulanceWithoutHorn
  • defaultLanguage
  • beaconAnimationEnabled
  • muteHornOnSirenSwitchPresets
  • excludeFromHornKeySwitchPresets

How Settings Are Applied

Server configuration
        ↓
Default settings are sent to the player
        ↓
Locally stored KVP preferences are loaded
        ↓
Available KVP preferences override server defaults
        ↓
Final effective settings are applied
  1. 1

    The resource loads the values from Config.Settings

    These values act as the default configuration for all players connected to the server.

  2. 2

    The player initializes the control panel UI

    When the player joins and the control panel initializes, the script checks for locally stored KVP preferences.

  3. 3

    Supported KVP values override server defaults

    When a stored player preference exists for an adjustable setting, that value takes precedence over the corresponding server default for that player.

  4. 4

    Server defaults apply when no override exists

    First-time players and players who have not changed a setting use the value defined in Config.Settings.


Resetting Player Settings

Players can reset their preferences by changing the values manually through the in-game settings panel.

Because these preferences are stored locally through FiveM's KVP system, server administrators cannot directly reset the individual settings of a specific player from the server configuration.

Changing a server default does not necessarily overwrite an existing player preference. When a player already has a locally stored KVP value for a supported setting, that local value continues to take precedence.