Configuration
F5 Redeem Code has two configuration files, both inside the config/ folder:
| File | Loaded as | Contents |
|---|---|---|
config/config.lua | shared | Everything below — general, command, admin, rewards, codes, framework/inventory, money, database, debug |
config/config_webhooks.lua | server-only | Discord webhook URLs, per-event colors, queue tuning (Webhooks) |
config/config_webhooks.lua is loaded only on the server. Never put webhook URLs in config.lua — they would leak to clients.
Sections in config.lua are ordered by how often a server owner needs them — general first, advanced tuning last.
General
F5Cfg.Locale = 'en'
| Option | Type | Default | Description |
|---|---|---|---|
Locale | string | 'en' | Translation file from locales/<code>.lua. Ships with en and pl. See Localization |
Command
F5Cfg.Command = {
redeem = 'redeem',
admin = 'redeemadmin',
suggestion = true,
}
| Option | Type | Default | Description |
|---|---|---|---|
redeem | string | 'redeem' | Chat command players run to open the redeem panel |
admin | string | 'redeemadmin' | Chat command admins run to open the management console |
suggestion | boolean | true | Show both /command hints in the chat suggestion list. false hides them |
See Commands.
Admin Panel
F5Cfg.Admin = {
acePermission = 'f5code.admin',
frameworkGroups = { 'admin', 'god' },
auditWebhook = true,
actionCooldownMs = 800,
pageSize = 25,
}
| Option | Type | Default | Description |
|---|---|---|---|
acePermission | string | 'f5code.admin' | ACE permission that grants access. '' disables the ACE path |
frameworkGroups | string[] | { 'admin', 'god' } | Framework groups that grant access. {} disables group-based access |
auditWebhook | boolean | true | Mirror admin actions and redemptions to Discord. When false, no webhooks are sent at all |
actionCooldownMs | number | 800 | Per-admin debounce on mutating actions — create / update / delete / clear history (ms) |
pageSize | number | 25 | Number of redemption-history rows loaded into the admin panel |
Access is granted if the player passes the ACE permission OR belongs to a listed framework group. See Admin Panel → Access Control.
Rewards
Global limits on what a single code can grant.
F5Cfg.Rewards = {
allowMoney = true,
allowItems = true,
maxMoney = 1000000,
maxItems = 10,
maxItemAmount = 100,
}
| Option | Type | Default | Description |
|---|---|---|---|
allowMoney | boolean | true | Intended master switch for money rewards. Reserved — see the note below |
allowItems | boolean | true | Intended master switch for item rewards. Reserved — see the note below |
maxMoney | number | 1000000 | Maximum total money per code (sum across all money accounts). A code exceeding it is rejected with admin_money_over_limit |
maxItems | number | 10 | Maximum number of distinct items per code. Extra items beyond the limit are dropped |
maxItemAmount | number | 100 | Maximum amount per single item. Each item amount is clamped to 1 … maxItemAmount |
allowMoney / allowItems are reservedThese two flags are present in the config but are not currently enforced by the server. The admin console always offers the Money, Items and Both reward types regardless of their values. maxMoney, maxItems and maxItemAmount are enforced.
See Features → Rewards.
Codes
Rules for the code strings themselves and the redeem flow.
F5Cfg.Codes = {
maxCodeLength = 32,
minCodeLength = 3,
caseInsensitive = true,
cooldownMs = 2000,
validatePrivateTarget = true,
maxPrivateTargets = 50,
}
| Option | Type | Default | Description |
|---|---|---|---|
maxCodeLength | number | 32 | Codes are truncated to this length on both redeem and create |
minCodeLength | number | 3 | Codes shorter than this are rejected on create (admin_invalid_data) |
caseInsensitive | boolean | true | true → SUMMER2024 and summer2024 match the same code (lookups and duplicate checks use LOWER()); false → codes are case-sensitive |
cooldownMs | number | 2000 | Per-player debounce between redeem attempts (ms). A faster retry returns redeem_cooldown |
validatePrivateTarget | boolean | true | true → private-code target Citizen IDs must exist in the player DB (online fast-path, then one batched query). false → skip the DB check and trust the input |
maxPrivateTargets | number | 50 | Maximum target Citizen IDs per private code. Extra targets beyond the cap are dropped |
See Features → Code scope and Features → Redeem validation.
Framework & Compatibility
Framework, inventory and notification selection. All default to 'auto'.
F5Cfg.Framework = {
mode = 'auto', -- 'auto' | 'esx' | 'qb' | 'qbx' | 'custom'
inventory = 'auto', -- 'auto' | 'ox' | 'qb' | 'qs' | 'ps' | 'codem' | 'tgiann' | 'esx_native' | 'custom'
notify = 'auto', -- 'auto' | 'framework' | 'oxlib'
notifyStyle = 'custom', -- 'custom' | 'native'
custom = { base = 'qb', getCore = nil, --[[ ... ]] },
}
F5Cfg.Inventory = {
imageUrl = 'auto',
custom = nil,
}
| Option | Type | Default | Description |
|---|---|---|---|
Framework.mode | string | 'auto' | 'auto' detects ESX/QB/QBX by resource; or force a specific adapter, or 'custom' for a fork |
Framework.inventory | string | 'auto' | 'auto' detects the inventory; or force one |
Framework.notify | string | 'auto' | 'auto' uses ox_lib when present, else the framework's native notify; 'framework' forces the framework; 'oxlib' forces ox_lib |
Framework.notifyStyle | string | 'custom' | 'custom' = this resource's styled in-NUI toasts; 'native' = hand the message to the notify backend |
Framework.custom | table | — | Custom-framework adapter config (only when mode = 'custom') |
Inventory.imageUrl | string | 'auto' | 'auto' matches the detected inventory's image path, or set a nui://<resource>/.../%s.png override used for item icons in the panels |
Inventory.custom | table | nil | Custom-inventory adapter callbacks (only when Framework.inventory = 'custom') |
The full detection logic, the custom adapter fields, and all per-inventory image paths are documented on the Framework Compatibility page.
Money & Currencies
Account-based (non-item) money. A code can pay out to one or several of these accounts at once.
F5Cfg.Money = {
payoutType = 'bank',
types = {
{ id = 'cash', label = 'Cash', icon = 'fa-solid fa-money-bill-wave', accounts = { qb = 'cash', qbx = 'cash', esx = 'money' } },
{ id = 'bank', label = 'Bank', icon = 'fa-solid fa-building-columns', accounts = { qb = 'bank', qbx = 'bank', esx = 'bank' } },
{ id = 'crypto', label = 'Crypto', icon = 'fa-solid fa-coins', accounts = { qb = 'crypto', qbx = 'crypto' } },
{ id = 'blackmoney', label = 'Black Money', icon = 'fa-solid fa-sack-dollar', accounts = { esx = 'black_money' } },
},
}
| Option | Type | Default | Description |
|---|---|---|---|
payoutType | string | 'bank' | Default account for legacy single-amount codes (codes stored without a per-account list). Must be the id of an active type |
types[].id | string | — | Internal currency id (alphanumeric, _ and -) |
types[].label | string | — | Display label shown in the admin console and rewards |
types[].icon | string | — | A Font Awesome class (e.g. fa-solid fa-coins) or an image path relative to the NUI |
types[].accounts | table | — | Native account key per framework (qb / qbx / esx) |
A type with no account for the active framework is auto-skipped (e.g. crypto has no ESX account, blackmoney has none on QB/QBox). If payoutType resolves to a skipped/invalid type, the bridge falls back to bank, then to the first active type. The active list is what admins see as the per-account money inputs when creating a code. See Framework Compatibility → Money & Currencies.
Database
F5Cfg.Database = {
autoCreateTables = true,
}
| Option | Type | Default | Description |
|---|---|---|---|
autoCreateTables | boolean | true | Create and migrate the schema on resource start. When false, no tables/columns/indexes are created or migrated — you must import code.sql and manage the schema yourself |
When autoCreateTables = true, the built-in schema creates both tables with every column; on installs that predate a column, migrations patch in the newer moneys, target_citizenids, creator_name, creator_steam and steam columns and the code_active generated column. The bundled code.sql is an older base subset missing those, and nothing is created or migrated when autoCreateTables = false. Keep the default unless you manage the schema yourself.
Debug
F5Cfg.Debug = {
enabled = false,
categories = {
INIT = true, BRIDGE = true, UI = true, CODE = true, REDEEM = true,
ADMIN = true, IO = true, WEBHOOK = true, SECURITY = true,
PERF = false, ERROR = true,
},
colors = { --[[ ANSI color per category ]] },
severityPrefix = { info = '', warn = '[WARN] ', err = '[ERR] ' },
perfThresholdMs = 50,
}
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | false | Master switch for all debug output (server, client, NUI). false → nothing prints regardless of category |
categories.<NAME> | boolean | mixed | Per-category toggle |
colors.<NAME> | string | ^1..^8 | FiveM ANSI color code per category (server console) |
severityPrefix | table | (see above) | Prefix per severity (info / warn / err) |
perfThresholdMs | number | 50 | DB queries slower than this (ms) log to the PERF category |
| Category | What it logs |
|---|---|
INIT | Resource start, config/schema loading, client readiness |
BRIDGE | Framework / inventory / money detection and resolution |
UI | NUI open/close, panel requests, frontend events |
CODE | Code lookups and validation during redeem |
REDEEM | The reward-granting pipeline |
ADMIN | Admin panel actions (create / update / delete / clear) |
IO | Database queries and the SQL bridge |
WEBHOOK | Discord webhook dispatch |
SECURITY | Rejected actions, cooldowns, missing permissions |
PERF | Slow DB queries above perfThresholdMs |
ERROR | Errors (always logged when the master switch is on) |
The Debug system is unified across server, client and NUI — the NUI receives its own copy of enabled + categories on every panel open, so the browser console mirrors the same category filtering. There are no loose print() calls; everything flows through F5Cfg.Debug.
See Also
- Framework Compatibility — framework / inventory / money detail and custom adapters
- Commands — the player and admin commands
- Features — what the reward and code options drive in-game
- Webhooks — the server-only
config/config_webhooks.lua - Admin Panel — the management console