⚙️Configuration

Configuration guide of Warning System.


1. Core Settings

Variable
Type
Default
Accepted values
Purpose

Config.Framework

string

"auto"

"auto", "esx", "qb"

Tells the script which framework to use. "auto" auto‑detects ESX or QB at runtime.

Config.Language

string

"en"

en, de, fr, es, pt

Selects the active locale from Config.Locales.

Config.Locales

table

{}

locale tables

Holds translation tables. (See Section 2).

How it works

  • On startup, getFramework() checks Config.Framework.

  • If set to auto, it searches for qb-core first, then es_extended.

  • If neither is found, the resource continues in stand‑alone mode.


2. Localization

The script ships with five ready‑made dictionaries (en, de, fr, es, pt).

Config.Language = "en"

Switch languages globally by changing Config.Language.


3. Command & Permissions

Variable
Type
Default
Description

Config.WarnCommand

string

"warn"

Chat command players with permission use (/warn).

Config.AllowedGroups

table

{ "god", "superadmin", "admin" }

Ace/Framework groups that may issue warnings.

Usage pattern: /warn <ID> "<Title>" "<Message>" Example: /warn 23 "THIS IS A WARNING" "Please stop glitching through walls."


4. Behaviour Settings

Variable
Type
Default
Purpose

Config.TimeToClose

number

20

Seconds before the warning UI auto‑closes.

Config.EnableGodmodeInWarn

bool

true

Make the warned player invincible while the overlay is active.

Config.DisableMovementInWarn

bool

true

Freezes player inputs during the warning.

Config.DisableWeaponsInWarn

bool

true

Removes weapon control so the player can’t shoot while being warned.


5. Hooks / Callbacks

Function
Side
When called
Typical use‑cases

Config.OnWarn(source)

client

As soon as the overlay appears

Play a sound, log to Discord, etc.

Config.OnWarnClose(source)

client

Right after the overlay closes

Re‑enable custom controls, send another log, etc.

Both callbacks are optional—leave them empty if not needed.


6. Notification Wrapper

Config.Notify = function(type, message)
    lib.notify({
        title       = Config.Locales[Config.Language]["title"],
        description = message,
        type        = type,        -- "success", "error", "info"
        position    = "center-right"
    })
end

Feel free to replace lib.notify with your preferred notification system; keep the function signature so internal calls remain intact.


7. Quick‑Start Checklist

  1. Copy the resource folder unchanged (must remain stg-warnsystem).

  2. Add ensure stg-warnsystem to your server.cfg.

  3. Edit config.lua to fit your server (language, groups, behaviour).

  4. Reload the script or restart the server.


For more help, contact support via discord.gg/stg.


🛒 Note: You can find this script on our Tebex store: STG Tebex

Last updated