Installation
F5 Redeem Code is a multi-framework reward-code system: players enter a code from a clean NUI panel and instantly receive money (single- or multi-account) and/or inventory items. Admins create, edit and delete codes from a full NUI console with usage limits, expiry dates, public/private targeting and a Discord audit trail — all on a self-detecting QBCore / QBox / ESX bridge.
Requirements
| Requirement | Details |
|---|---|
| Framework | QBCore, QBox Core, or ESX (auto-detected) |
| FiveM Server | Recent artifacts recommended |
| Lua | 5.4 (enabled automatically via lua54 'yes') |
| Database | MySQL 5.7+ / MariaDB 10.2+ (8.0+ / 10.6+ recommended) |
| Database Resource | oxmysql (recommended), mysql-async, or ghmattimysql — auto-detected by the built-in SQL bridge (see note below) |
| Inventory | ox_inventory, qb-inventory, qs-inventory, ps-inventory, codem-inventory, tgiann-inventory, ESX native, or custom — all supported |
F5 Redeem Code automatically detects your framework and inventory at startup — no manual configuration needed. Framework detection priority is QBox → QBCore → ESX (qbx_core → qb-core → es_extended). See Framework Compatibility for the full detection logic and how to force a specific adapter.
The script ships a built-in SQL bridge (server/sql_bridge.lua) that auto-detects and supports oxmysql, mysql-async and ghmattimysql out of the box (checked in that priority order, within a 30 s window). It builds a unified MySQL.* layer, so any of the three works with no code changes.
The manifest declares no hard database dependency, so the resource starts on whichever supported driver is running — just make sure your DB resource starts before f5_redeemcode (see the server.cfg examples below). oxmysql is the recommended default.
The f5_codes table uses a generated column (code_active) so soft-deleted codes free their name for re-creation. That feature needs MySQL 5.7+ / MariaDB 10.2+. On older servers the migration is skipped and the resource falls back to the legacy unique key — everything else still works. See Framework Compatibility → Database schema.
Step by Step
1. Download
F5 Redeem Code is free and open-source. Download the latest release from GitHub.
2. Folder Structure
Place the resource in your server's resources directory. The folder must be named f5_redeemcode (the NUI callbacks are addressed to this exact resource name):
resources/
[f5]/
f5_redeemcode/
bridge/
client/
config/
config.lua
config_webhooks.lua
html/
locales/
server/
code.sql
shared.lua
fxmanifest.lua
config/Both config files are inside the config/ folder — config/config.lua and config/config_webhooks.lua. The manifest loads them from there. Whenever this documentation says "open config.lua", it means config/config.lua.
3. Server Config
Add the resource to your server.cfg — make sure it starts after your framework, oxmysql, and (if used) your inventory resource:
- QBCore
- QBox Core
- ESX
ensure oxmysql
ensure qb-core
ensure qb-inventory
ensure f5_redeemcode
ensure oxmysql
ensure ox_lib
ensure ox_inventory
ensure qbx_core
ensure f5_redeemcode
ensure oxmysql
ensure es_extended
ensure ox_inventory # optional — ESX native inventory works too
ensure f5_redeemcode
F5 Redeem Code must start after your framework, oxmysql and inventory. Incorrect boot order is the most common installation issue — the bridge runs its framework/inventory detection once at startup, and if those resources aren't up yet the resource goes inert.
4. Database
No manual SQL import is required. On first start the script auto-creates both tables (and applies migrations on later updates):
| Table | Purpose |
|---|---|
f5_codes | Every code and its rewards, limits, expiry and scope |
f5_code_redemptions | Redemption history — who redeemed what, when |
This is controlled by F5Cfg.Database.autoCreateTables (default true). When you update the script, new columns and indexes are applied as migrations on startup — no manual SQL needed.
If you prefer to manage the schema yourself, set autoCreateTables = false and import the bundled code.sql. See the note below and Configuration → Database.
The built-in auto-create schema is complete and current — it creates both tables with every column, including 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 that's missing those. On installs that predate a column, startup migrations (ALTER TABLE) patch it in. If you disable autoCreateTables, neither the full schema nor the migrations run — keep the default (true) unless you manage the schema yourself.
5. Configure Locale
Open config/config.lua and set your language code:
F5Cfg.Locale = 'en' -- ships with: en, pl
The script ships with English and Polish. See Localization for adding your own.
6. Configure Admin Access
The /redeemadmin panel is gated by an ACE permission or a framework group:
F5Cfg.Admin = {
acePermission = 'f5code.admin', -- '' disables the ACE path
frameworkGroups = { 'admin', 'god' }, -- {} disables group-based access
-- ...
}
Grant the ACE in your server.cfg if you use the ACE path:
add_ace group.admin f5code.admin allow
Access is granted if the player passes the ACE permission OR belongs to a listed framework group. See Admin Panel → Access Control.
7. Configure Discord Webhooks (optional)
Open config/config_webhooks.lua (a server-only file) and paste a Discord webhook URL into Webhooks.defaultUrl to enable audit logging of code creation, edits, deletions, redemptions and history clears. See Discord Webhooks.
8. Verify
Restart your server. With F5Cfg.Debug.enabled = true (and the relevant categories on) the bridge prints what it detected:
[SERVER][IO] [sql_bridge] driver detected: oxmysql
[SERVER][BRIDGE] detected framework=qb inventory=qb
[SERVER][INIT] f5_code server ready (framework=qb inventory=qb)
If detection fails you'll instead see (resource goes inert):
[SERVER][ERROR] [ERR] [BRIDGE] no supported framework detected (esx/qb/qbx) — resource inert
[SERVER][ERROR] [ERR] [BRIDGE] no supported inventory detected for framework esx
In-game, run /redeem to open the player panel, and /redeemadmin as an admin to verify the console opens.
Next Steps
- Configuration — every option in
config/config.lua - Commands —
/redeem,/redeemadmin, chat suggestions - Features — rewards, code scopes, limits, expiry and the redeem flow
- Framework Compatibility — frameworks, inventories, money, custom adapters
- Admin Panel — creating and managing codes, access control
- Discord Webhooks — audit logging
- Localization — supported languages, adding your own
- Troubleshooting — fixes for common issues