[Free] LXR-PromoCode | One-Time Promo Code Redemption System [All Frameworks]
LXR-PromoCode
One-time promo code redemption system with full SQL persistence for RedM.
Give out promo codes for streamer events, community giveaways, welcome bonuses, or seasonal promotions. Every code is redeemed once per player β permanently tracked in the database across restarts.
Store: https://www.lxrcore.com
Discord: discord.gg/CrKcWdfd3A
Documentation: Included in the resource (docs/ folder)
Preview
(Coming Soon)
Features
- SQL-persistent redemptions β claims survive server restarts permanently. No file-based storage, no JSON, no data loss.
- One redemption per player per code β enforced by a 5-layer anti-exploit guard system (memory cache β cooldown lock β DB SELECT β INSERT IGNORE β UNIQUE constraint)
- Global use limits β optionally cap total redemptions per code (e.g. first 50 players only)
- Enable/disable codes on the fly β toggle codes in config without removing them
- Configurable rewards β set custom dollar amounts per code
- Discord webhook logging β every redemption logged with player name, identifier, code, and reward amount
- Multi-framework support β auto-detects your framework or set it manually
- Localization ready β ships with English and Georgian locale files, easy to add your own
- Auto table creation β the SQL table is created on first boot, no manual import required
- Resource name enforcement β escrow-protected guard prevents folder renaming exploits
- 0.00ms idle β server-authoritative command handler, no tick loops, no polling, zero idle performance cost
- Lua 5.4 β modern Lua with
lua54 'yes'
Supported Frameworks
| Framework | Status |
|---|---|
| LXR-Core | |
| RSG-Core | |
| VORP Core | |
| RedEM:RP | |
| QBR-Core | |
| QR-Core | |
| Standalone |
Auto-detection order: LXR β RSG β VORP β RedEM:RP β QBR β QR β Standalone. First found wins. Override manually in config.lua if needed.
How It Works
- Define promo codes in
config.luawith reward amounts, enabled state, and optional global use limits - Players type
/redeem CODEin chat - Server validates the code through 5 layers of protection before granting the reward
- Redemption is permanently stored in MySQL β code cannot be reused by that player, ever
Anti-Exploit: 5-Layer Guard System
Every redemption passes through all five layers before money is awarded:
- DatabaseReady flag β blocks all commands until SQL cache is fully loaded on boot
- Per-player cooldown lock β prevents rapid command spam and race conditions
- In-memory cache check β fast-path rejection, no DB query needed for repeat attempts
- Direct SQL SELECT β catches stale cache edge cases after restarts
- INSERT IGNORE + UNIQUE constraint β database-level final wall, mathematically impossible to bypass
If the money add fails after DB insert, the row is rolled back automatically.
Installation
- Place
lxr-promocodein yourresourcesfolder β folder name must be exactlylxr-promocode - Add to
server.cfg:
ensure oxmysql
ensure lxr-promocode
- Edit
config.luaβ add your promo codes, set framework, optionally add Discord webhook - Start/restart the server β SQL table is created automatically
Configuration Example
Config.PromoCodes = {
{
code = 'WELCOME100',
reward = 100,
enabled = true,
maxUses = 0, -- 0 = unlimited (still 1 per player)
},
{
code = 'STREAMER500',
reward = 500,
enabled = true,
maxUses = 50, -- first 50 players only
},
}
Dependencies
- oxmysql (required)
- Any supported framework listed above (or standalone)
Accessible Files (Escrow)
This resource uses the Asset Escrow system. The following files are not escrowed and fully accessible to buyers:
config.luaβ all configurationfxmanifest.luaβ resource manifestREADME.mdβ documentationdocs/**β full documentation (install guide, config reference, framework compatibility, events, troubleshooting, changelog)locales/**β English and Georgian locale filessql/**β manual SQL import file
Core logic files (server/server.lua, client/client.lua, shared/framework.lua) are escrow-protected.
Store
Support
Join the Discord for setup help and support:
discord.gg/CrKcWdfd3A
| Code is accessible | Partly (config, locales, docs, SQL) |
| Subscription-based | No |
| Lines (approximately) | ~920 |
| Requirements & dependencies | oxmysql |
| Support | Yes |
