MySQL bans with reason, admin and expiry, checked asynchronously on connect with threaded SQLx.
CSB Ban Manager keeps your bans in MySQL instead of banned.cfg, so every server in your community shares one ban list and your website can read it. All queries go through threaded SQLx (SQL_ThreadQuery), which means a slow or dead database never freezes the game thread — the worst case is that a ban check silently does not fire.
Inspired by AMXBans (Kanagava and the AMXBans team). This is an independent GPL re-implementation with its own, deliberately small schema; no AMXBans code is reused.
How it works
amx_ban <target> <minutes> [reason]inserts a row (SteamID, IP, player name, admin name, admin SteamID, reason, created, expires) and kicks the player.- On
client_authorizedthe plugin fires an asyncSELECTmatching the SteamID or the IP, ignoring rows whoseexpiresis in the past. - If a row comes back, the player gets a MOTD with the reason, the banning admin and the time left, and is then kicked.
Features
- Timed bans (minutes) and permanent bans (
0). - SteamID and IP matching — catches non-Steam clients that change their SteamID.
amx_bansshows the 20 most recent bans as a MOTD table.amx_unban <steamid>deletes the row and also runsremoveid+writeidso an old engine ban does not survive.- The table is created automatically on map start with
CREATE TABLE IF NOT EXISTS. - All user-supplied strings are stripped of quotes, backslashes and control characters before they touch a query.
Installation
- Make sure the
mysqlmodule is enabled inaddons/amxmodx/configs/modules.ini. - Compile and drop
csb_ban_manager.amxxintoaddons/amxmodx/plugins/, add it toplugins.ini. - Put the credentials in
addons/amxmodx/configs/amxx.cfg(or aserver.cfgthat runs before the map starts):csb_ban_host "127.0.0.1",csb_ban_user "csb",csb_ban_pass "secret",csb_ban_db "csb". - Change the map. The
csb_banstable is created on the first map load.
Troubleshooting
If nothing is ever inserted, check addons/amxmodx/logs/ — every failed query is logged with the MySQL error string. A blocked port 3306 or a user without CREATE privileges are the two usual causes.









