View Single Post
Author Message
TSCDan
Senior Member
Join Date: Jan 2005
Location: NY, USA
Old 07-05-2007 , 09:03   Bad name banning
Reply With Quote #1

Bad name banning
This is a pretty simple plugin to ban anybody who joins with or changes their name to something that contains a bad phrase in the bad_names.ini. I created this to ban people with myg0t/mygot in their name, but it has been modified for any name. For those of you who don't know, myg0t is a group/clan of people who blatantly hack and ruin other people's fun, and then gloat about it to their friends. I got a bit tired of people doing so, so I did something about it

At the request of ferret, I made this configurable to read any bad phrases from a config file. Thanks for all the help from the guys on IRC (Namely ferret )

I have also added functionality of a whitelist: any steamID's that exist in it will not be banned no matter what the name is (as long as sm_bnb_allowimmun is 1). If sm_bnb_allowimmun is 0, you will be kicked/banned no matter what if you have a bad name.

I also added a version that has Admin 'b' flag immunity. I'm retaining the old version in case there are some people who would prefer not to give admin privs out.

Instructions
WHITELIST VERSION
Place BadNameBan.smx in plugins.
Place bnb_whitelist.ini and bad_names.ini in configs. Edit them to your liking (which names should be banned or kicked/which steamID's will not be banned).
Place the below cvars into your server.cfg (or any config that gets executed) and change them to what you would like.
ADMIN VERSION
Place BadNameBanAdmin.smx in plugins.
Place bad_names.ini in configs, and edit it to your liking (which names should be banned or kicked).
Place the below cvars into any config that gets executed and change them to your liking (with the exception of sm_bnb_allowimmun; it does nothing in this release).
Any admins with 'b' flag will not be kicked by this version.

Done!


cvars
sm_bnb_bantime - can be configured to set how long they should be banned for in minutes, default is -1 (just a kick), 0 = permanent.

sm_bnb_reason - reason for why the player was kicked/banned. Default is "Bad name"

sm_bnb_allowimmun - Allow immunities in the form of SteamID's in bnb_whitelist.ini.

sm_bnb_log - Allow kicks/bans to be logged to an external log file, (sourcemod/logs/bnb_log_mmddYYYY.log) 0 off, 1 on

changelog
1.59 (9/23/07) - Coulda sworn that worked in the past... fixed two issues. Fully functional now
1.58 (8/31/07) - Friggin vague documentation -_-* Fixed an issue with the flag being set in groups not working correctly. Should be all set now
1.57 (8/30/07) - Fixed an issue where the admin check was done before the admin privs were loaded from SQL.
1.56/1.46 (8/30/07) - Fixed a blonde moment (Using the rcon commands, not sm... gah!)
1.45 (8/29/07) - Fixed a typo on the whitelist version.
1.5 (8/24/07) - Different release to allow generic admins as immunity instead of separate whitelist. Admins with 'b' flag will not be banned.
Removed sm_bnb_allowimmun for new release.
1.4 - Added external logging capabilities via sm_bnb_log cvar (0 off, 1 on)
Kicks are logged to logs/bnb_log_mmddYYYY.log
1.3 - Added whitelist functionality and a few cvars.
Any SteamID's in configs/bnb_whitelist.ini will not be banned as long as sm_bnb_allowimmun is 1
Changed all cvar names to sm_*
1.2 - Completely redid the plugin, added configurable names and bantime, renamed plugin.
bnb_bantime can be -1 for just a kick, 0 for perm ban, or >0 for a ban in minutes.
Added a reason cvar to change the reason of why they were banned/kicked
Changed the default value of sm_bnb_bantime to -1 (just a kick)
Config file (configs/bad_names.ini) has a one-name per line config, pretty simple.
1.1 - Added mgb_version cvar
1.0 - Release
Attached Files
File Type: ini bad_names.ini (169 Bytes, 1898 views)
File Type: ini bnb_whitelist.ini (420 Bytes, 1629 views)
File Type: sp Get Plugin or Get Source (BadNameBan.sp - 3069 views - 5.1 KB)
File Type: sp Get Plugin or Get Source (BadNameBanAdmin.sp - 2673 views - 3.7 KB)

Last edited by TSCDan; 09-23-2007 at 10:01.
TSCDan is offline
Send a message via AIM to TSCDan Send a message via MSN to TSCDan Send a message via Yahoo to TSCDan