Administration

ShadowBan

Advanced ban system with native AdaptiveCards and an unban request workflow.

Version
1.6.0
Resource
SF-Ban
Version 1.6.0 Resource SF-Ban Frameworks ESX ยท QBCore ยท Standalone Bundled languages 5 Store page View

Overview#

SF-Ban replaces the plain kick message with five native AdaptiveCards displayed directly inside the FiveM launcher: the ban notice, the appeal form, the confirmation, and the follow-up screens. Bans are matched on every identifier a player carries, so changing licence alone is not enough to come back. Staff get thirteen commands, players get a self-service appeal flow, and everything lands in Discord as a formatted embed.

Five native AdaptiveCards

The ban notice, appeal form and confirmations are rendered by the FiveM launcher itself, with no external website.

Multi-identifier matching

Every identifier seen for a player is stored, so a ban still applies after a licence change.

Self-service appeals

Banned players submit an appeal from the ban screen; staff approve or deny it with a command.

Flexible durations

Seconds, minutes, hours, days, weeks, months, years or permanent.

Full history

Every ban, unban and appeal is kept, so you can see a player entire record.

Five Discord embed types

Ban, offline ban, unban, appeal submitted and appeal handled each get their own embed.

Search and statistics

Search bans by name or identifier and pull per-player statistics.

Automatic cleanup

Purge expired bans and old appeals with a single command.

Dependencies#

ResourceRequiredWhy
oxmysqlYesStores bans, identifiers, appeals and history.
MySQL / MariaDBYesNeeds support for views, stored procedures and triggers.

Installation#

  1. Drop the SF-Ban folder into your server resources directory.
  2. Import the SQL file shipped with the resource: it creates four tables, one view, three stored procedures and their triggers.
  3. Add the ensure lines below to your server.cfg.
  4. Set your Discord webhooks and your timezone in config.lua.
  5. Give the shadowban ACE permissions to your staff groups.
server.cfg
ensure oxmysql
ensure SF-Ban

add_ace group.admin shadowban.admin allow
add_ace group.mod shadowban.moderator allow
add_ace group.mod shadowban.tempban allow

Configuration#

KeyDefaultWhat it does
Config.TimezoneUTC+2Timezone used to display ban dates and expiry.
Config.Webhooksโ€”One Discord webhook per embed type.
Config.Languageโ€”Language of the AdaptiveCards and messages.
Config.UnbanRequestsโ€”Enables the appeal flow and sets its cooldown.

Commands#

CommandPermissionWhat it does
/sban [id] [duration] [reason]shadowban.tempbanBan a connected player.
/sbanoff [identifier] [duration] [reason]shadowban.adminBan a player who is not connected.
/sunban [banId]shadowban.adminLift a ban.
/sbaninfo [banId]shadowban.moderatorShow every detail of a ban.
/sbanlistshadowban.moderatorList the currently active bans.
/ssearchbans [query]shadowban.moderatorSearch bans by name or identifier.
/sbanhistory [identifier]shadowban.moderatorShow the complete ban history of a player.
/splayerstats [identifier]shadowban.moderatorShow the statistics of a player: bans, warnings, appeals.
/sunbanrequest [message]Banned playerSubmit an appeal. Used by the banned player.
/sunbanrequestsshadowban.adminList the pending appeals.
/sapproverequest [requestId]shadowban.adminApprove an appeal and lift the ban.
/sdenyrequest [requestId] [reason]shadowban.adminDeny an appeal.
/scleanbansshadowban.adminPurge the bans that have expired.
/scleanrequestsshadowban.adminPurge the handled appeals.
/shelpโ€”Show the list of available commands in game. /sbhelp is an alias.
/slogsshadowban.logBrowse the logs recorded by the resource.
/sloginfo [logId]shadowban.logShow the detail of a log entry.
/sclearlogsshadowban.logClear the stored logs.
/smetricsAdminShow the performance metrics of the resource.

Permissions#

ACE nodeGroupAllows
shadowban.adminโ€”Full access: ban, unban, handle appeals and run cleanups.
shadowban.tempbanโ€”Issue temporary bans only.
shadowban.moderatorโ€”Read-only access: list, search, inspect bans and statistics.
shadowban.logโ€”Access to the log commands: browse, inspect and clear the logs.

Database#

TableContents
shadowban_bansThe bans themselves: reason, author, start, expiry and status.
shadowban_identifiersEvery identifier tied to a banned player, used to match on reconnection.
shadowban_unban_requestsAppeals submitted by banned players and their outcome.
shadowban_historyImmutable trail of every ban and unban action.

Good to know#

Durations accept the suffixes s, m, h, d, w, mo, y, or the keyword perm for a permanent ban.
The configuration file is over 500 lines: every message shown in the AdaptiveCards can be rewritten without touching the code.
Bans are checked in playerConnecting, before the player finishes loading, so a banned player never reaches the session.