Skip to main content
The sh-admin resource gives RedM staff a centralized administration toolkit through a NUI panel, hotkeys, and chat commands. It supports online player management, teleport tools, spectating, report handling, warns, kicks, bans, unbans, inventory grants, finance adjustments, job tools, offline player management, maintenance mode, Discord webhook logging, trust score enforcement, and developer tools. Access is validated server-side for every sensitive action. The primary permission source is Discord role membership through the Discord API, with ACE permissions, framework groups, framework jobs, and command ACE as fallback sources.
Keep Discord bot tokens and webhook URLs out of public docs, screenshots, and repositories. If a real token or webhook URL has already been shared, rotate it in Discord before using this resource in production.

Requirements

  • RedM server using fx_version 'cerulean' and game 'rdr3'
  • oxmysql, started before sh-admin
  • One supported framework:
    • VORP
    • RSG / RSG Core
  • MySQL or MariaDB database access for the tables in install/sql.sql
  • Discord bot token and guild ID if Discord role permissions, whitelist, or bot presence are enabled
  • The folder/resource must be named exactly sh-admin
The resource declares lua54 'yes' and node_version '22'. The Node runtime is used by server/discord_presence.js when Discord bot live presence is enabled.

Installation

1

Install dependencies

Ensure oxmysql and your framework resource are installed and working.
2

Add the resource

Copy the folder into your server resources directory and keep the folder name as sh-admin.
3

Import SQL

Run install/sql.sql against your database.
4

Configure server.cfg

Start dependencies first, then start sh-admin.
server.cfg
5

Configure permissions

Add Discord role IDs and/or ACE permissions before opening the panel on a live server.
6

Restart and verify

Restart the server, join with a permitted account, and open the panel with /admin or PageDown.

Framework Support

Set framework detection in config.lua:
config.lua
The framework bridge handles player identity, inventories, item catalogs, money, jobs, bank balances, drops, and coordinate lookups. Banking can be controlled separately:
config.lua

Permissions

Permission checks run in this order:
  1. Discord role permissions from Config.DiscordRoles
  2. Action-specific ACE nodes from Config.Permissions.Ace.Map
  3. Framework user groups and character groups from Config.Permissions.UserGroups
  4. Framework job allowlist from Config.Permissions.Jobs
  5. Final command ACE fallback such as command, group.admin, rsgcore.admin, or rsgcore.god

Discord Role Permissions

Configure your bot token, guild ID, role buckets, and action mappings:
config.lua
Run this diagnostic command from the server console or in-game as an admin:

ACE Fallback

Use ACE permissions when Discord role checks are disabled, unavailable, or not desired for a specific deployment:
server.cfg
Never grant sh.admin.menu, sh.admin.*, or broad command ACE permissions to group.everyone or builtin.everyone.

Common Action Keys

Commands

All public command names are configurable in Config.Commands. Command examples:
The report and request commands use a pipe character (|) between the short title and the full message when arguments are supplied. With no arguments, they open the compact NUI report form when Config.Reports.OpenPromptOnCommand is enabled.

Hotkeys

config.lua
The client also registers internal commands sh_admin_open and sh_admin_noclip; those forward to server-side permission checks.

Admin Panel Tabs

Shows online player count, report counts by status, selected player summary, recent reports, and quick buttons for Players, Reports, and data refresh.
Includes teleport to marker, self revive, noclip, invisibility, god mode, player IDs, player blips, self item or weapon grants, and self finance tools.
Shows live player list data including source ID, name, job, and ping. Staff can view profile/history, open inventory, goto, bring, spectate, freeze/unfreeze, grant items or weapons, adjust money, set or remove jobs, warn, kick, and ban.
Players can submit reports. Staff can filter reports, view nearby player snapshots, claim or unclaim, add staff notes, reply to the reporter, change status, delete reports, goto/bring the reporter, and teleport back after assisting.
Includes coordinate copy formats, item database editor, item catalog loading, horse and wagon spawning, nearest horse/wagon deletion, zone clearing, and entity lookup by network ID.
Provides configurable Ban QuickSets, Reason Catalog auto-duration matching, active ban listing, and unban tools.
Searches indexed offline players by name, character ID, or identifier. Staff can add notes, queue finance changes, force queue sync if the player is online, and apply offline bans.
Controls maintenance join lock and full-screen staff broadcasts. Recent broadcast history is stored and shown in the panel.

Reports

Report behavior is configured in Config.Reports:
config.lua
When staff use report goto/bring flows, the script can temporarily change the admin model and save a return point. Set AssistPedModel = nil to disable the temporary model. Set RestoreCharacterCommand = nil or false if your framework should not run a restore command.

Bans And Punishments

/ban and the panel support temporary bans and permanent bans. A ban duration of 0 means permanent. Active bans are checked during playerConnecting.
config.lua
If staff type a reason matching the reason catalog and do not provide an explicit duration, sh-admin applies the configured duration.

Trust Score And Playtime

sh-admin tracks account-wide playtime and trust score using sh_admin_trustscore.
config.lua
Scores are clamped to the configured min and max. When trust falls strictly below the auto-ban threshold, the player is automatically banned for the configured duration. Players can view their own playtime and score with /myplaytime.

Whitelist

The join whitelist uses Discord role IDs:
config.lua
If FailClosed is true, players are denied when Discord API checks are unavailable. Staff can bypass with any configured maintenance or whitelist bypass ACE.

Maintenance Mode

Maintenance mode blocks new joins while allowing configured ACE bypasses:
config.lua
Maintenance state and broadcast history are stored in SQL, so lock state survives resource restarts.

Discord Webhooks

Admin actions, reports, bans, finances, jobs, devtools actions, and security events can log to Discord webhooks.
config.lua
Empty channel URLs fall back to Default.

Discord Bot Presence

The optional Discord bot presence updater connects to the Discord Gateway and updates the bot activity text.
config.lua
Supported placeholders are {server}, {players}, {max}, {uptime}, {uptime_seconds}, {uptime_days}, {uptime_hours}, and {uptime_minutes}.

Item And Weapon Tools

The player and self grant pickers use framework catalogs plus the sh_admin_items item editor table. Catalog size can be tuned:
config.lua
The item editor can write VORP items directly into the framework items table when running VORP. For RSG, it stores editor rows in sh_admin_items and prints an RSG item snippet to the server console.

Database Tables

The install SQL creates these tables: The script also creates or migrates some item editor columns at runtime.

Exports

Other resources can check admin access or frozen state:
HasAdminAccess accepts any sh-admin action key and runs the same server-side permission logic.

Localization

Set the active locale in config.lua:
config.lua
Language files are loaded from locales/*.lua and can be edited because they are included in escrow_ignore.

Troubleshooting