Admin Panel
The admin console — opened with /redeemadmin — is a full NUI Code Manager for creating and managing codes and browsing the redemption history.
Access Control
The panel is gated server-side. A player gains access if they pass the ACE permission OR belong to a listed framework group:
F5Cfg.Admin = {
acePermission = 'f5code.admin', -- '' disables the ACE path
frameworkGroups = { 'admin', 'god' }, -- {} disables group-based access
}
Grant the ACE in server.cfg:
add_ace group.admin f5code.admin allow
A non-admin who runs /redeemadmin gets the admin_no_permission notification and the panel never opens. Every mutating action re-checks permission and a per-admin cooldown (actionCooldownMs, default 800 ms) on the server — the client can never bypass it.
Tabs
The console has three tabs:
| Tab | Purpose |
|---|---|
| Create Code | Build a new code (also used to edit an existing one) |
| Active Codes | Browse, search, edit and delete live codes |
| History | Browse and search the redemption log; clear it |
Create Code
Code
Type a code manually, or click Generate for a random one in the format XXXX-XXXX-XXXX (three 4-character groups from an unambiguous alphabet — no I, O, 0 or 1). Codes must be at least minCodeLength characters; duplicates of a live code are rejected (admin_code_exists).
Reward type
A toggle selects what the code grants:
| Choice | Stored reward_type |
|---|---|
| Money | money |
| Items | item |
| Both | both |
Money accounts
When the reward type includes money, one numeric input appears per active money account (Cash, Bank, Crypto, Black Money… depending on your framework — see Framework Compatibility → Money). Enter an amount on any account you want to pay; leave the rest at 0. At least one amount must be > 0, and the total must not exceed F5Cfg.Rewards.maxMoney.
Items
When the reward type includes items:
- Type an item name (with autocomplete against your inventory's item list) and an amount, then click Add.
- Add up to
F5Cfg.Rewards.maxItemsdistinct items; each amount is clamped to1 … maxItemAmount. - View Full List opens a searchable modal of every server item to pick from.
Max uses
Total redemptions allowed across all players. 0 = unlimited.
Expiry date
Optional date/time picker. Leave it empty for a code that never expires. After the chosen moment, redeeming returns redeem_expired.
Private code
Toggle Private Code to lock the code to specific players:
- Add one or more target Citizen IDs (type an ID and add it, or use Choose from list to pick from the online player picker).
- Up to
F5Cfg.Codes.maxPrivateTargetstargets. - Targets are validated when you save (unless
validatePrivateTarget = false). See Features → Target validation.
Online player picker
The Choose from list modal lists online players with their character name, Citizen ID and Steam HEX, searchable by any of those. Selecting a player adds their Citizen ID as a target.
Active Codes
A searchable table of every live code:
| Column | Shows |
|---|---|
| Code | The code string (click to copy) |
| Type | Money / Items / Both |
| Rewards | Money per account and item list |
| Uses | uses / max_uses (or unlimited) |
| Expiry | Expiry date, or none |
| Scope | Public or Private badge |
| Creator | Who created it (Creator Steam HEX click-to-copy) |
| Actions | Edit and Delete |
The search box filters across codes, rewards, scope and creator.
- Edit loads the code into the Create tab (now showing Save Changes / Cancel Edit), pre-filling every field so you can adjust and save.
- Delete asks for a quick confirm, then soft-deletes the code (history is preserved; the name becomes reusable).
History
A searchable log of every redemption:
| Column | Shows |
|---|---|
| Code | The redeemed code |
| Redeemed By | Player name / Citizen ID (and Steam HEX, click-to-copy) |
| Rewards | Money and items granted |
| Date | When it was redeemed |
The search box filters across codes, players, Citizen IDs and Steam HEX. Clear History requires a second confirming click ("Are you sure?") and then deletes all redemption rows — this cannot be undone.
What loads on open
Opening the panel sends the client a single payload: the active codes, the most recent redemption history (up to F5Cfg.Admin.pageSize rows), the full item catalogue (for autocomplete), the active money types, and the locale bundle. Creating, editing or deleting a code refreshes the active-codes list in place.
Discord audit
Every admin action is mirrored to Discord when F5Cfg.Admin.auditWebhook = true and a webhook URL is set: code created, edited, deleted, and history cleared — plus every player redemption. See Webhooks.
See Also
- Features — what each field does at redeem time
- Configuration → Admin Panel — access and cooldown options
- Framework Compatibility → Money — which accounts appear
- Webhooks — the admin audit trail