Simple Mysql Whitelist
Mysql database whitelister to control player access to server[s].
Currently Tested [CSS][CS:GO]
Description:
Spoiler
As i've seen some "
Advanced" and "
old/outdated" mysql whitelist's i decided to rewrite one more Simple yet functional whitelist to today's standards including all code being written in SourcePawn Transitional Syntax.
Plugin used as Base:
https://forums.alliedmods.net/showthread.php?t=162859
Requirements:- A mysql database (obviously)
Ingame Commands:- All Ingame commands including menu requires Admin-Root access.
- sm_whitelist Opens the menu to list/remove
- sm_whitelist_add Add a steamid to the database.
- sm_whitelist_delete Deletes a steamid from the database.
- sm_whitelist_list List all SteamIDs in the database.
Server Commands:- sm_server_whitelist_add Add a steamid to the database. Useable by Rcon or Console
- sm_server_whitelist_delete Deletes a steamid from the database. Useable by Rcon or Console
Cvars:- sm_whitelist_adminflag "0" Admin flag required [a -> z] [0 = OFF].
Installation:
Spoiler
Step 1. Throw the compiled smx into plugins folder.
Step 2. Head to your
addons\sourcemod\configs\databases.cfg and put the below with correct information.
Code:
"whitelister" //do not change this name
{
"driver" "mysql"
"host" "Your hostname here"
"database" "mysql_whitelist" //Database table name here
"user" "Username here"
"pass" "Password here"
}
Step 3.
Once everything is set, you'll have to add yourself to the database,
this is done either by using:
1. Server command called
sm_server_whitelist_add by console/rcon.
2. Or by going to your mysql database name, then click it, and click the database table name, then you'll see a "
insert" button click this, now you'll see a box where you simply put your steam2 id, they look like this
STEAM_0:0:12345678 Then you click "
GO"
Then your done and ready to load up the server and connect! From there you can add steamids by being ingame straight to the database.
Changelog:
Code:
1.0 - Plugin release
1.1 - Added flags support and minor code edits.
1.2 - Added bots to be allowed!
1.3 - New method for faster player kick.
1.4 - Threaded queries been updated for safer use.
1.5 - Added ServerCommands, Optimized mysql and fixed reported bugs.