View Single Post
Author Message
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-05-2011 , 20:32   [ANY] Name Change Punisher (Updated 2011-07-13)
Reply With Quote #1

My servers have had an influx of spammers who use name changing scripts as of recently.

Therefore, I wrote a quick script to help get rid of them.

What it does is track name changes, and if X name changes happen within Y seconds of each other, it kicks or bans them.

This plugin was tested on Team Fortress 2.

On games that support sv_namechange_cooldown_seconds (HL2:DM, DoD:S, CS:S, TF2, and possibly others):
You should adjust the ncp_detectiontime based on the values you use for sv_namechange_cooldown_seconds. For instance, if sv_namechange_cooldown_seconds is 20 (the default), ncp_detectiontime should be somewhere between 25 and 30.

The above should be considered mandatory to block LMAOBox.

Changelog:
  • 1.1 - SourceBans will now be used if present.
  • 1.0.2 - Fixed ban not working properly because of a mistake in the translation handling.
  • 1.0.1 - Added ban source of "ncp" so that the OnBanClient hook fires.
  • 1.0 - Initial release.
Installation:
  1. Copy namechangepunisher.phrases.txt into addons/sourcemod/translations/ (possibly updated with translations later)
  2. Copy namechangepunisher.smx into addons/sourcemod/plugins/
Configuration:

This plugin creates a configuration file: cfg/sourcemod/namechangepunisher.cfg
The following convars exist in this plugin:
  • ncp_detections [val] (min 3, max 20, def 5) - Number of detections before taking action
  • ncp_detectiontime [val] (min 5. max 60, def 10) - Max length of time in seconds between detections before counter resets
  • ncp_punishmode [0/1] (def 1) - 0 = Kick, 1 = Ban.
  • ncp_banlength [val] (def 60) - If ncp_punishmode is 1, how many minutes to ban for? 0 means indefinitely.
  • ncp_debug [0/1] (def 0) - Show debug information when names are changed. This may disappear in later versions, it's mainly present in case there are problems with the plugin, server admins can see what's going on and report any strange behavior they see.
  • ncp_version [val] (def 1.0) - Name Change Punisher version
Commands: There are none.

At present there is no cvar to disable the plugin.

FAQ:
Q. Why is it amount of time between detections and not the number of detections in a certain amount of time?
A. That would add a lot of complexity to the plugin, mainly with having to track ncp_detections -1 timestamps for each user that has changed their names. For performance reasons, it's recommended in SourcePawn that you don't re-index arrays.

Get Plugin link does not work because this plugin requires SourceBans include file sourcebans.inc.
Attached Files
File Type: txt namechangepunisher.phrases.txt (150 Bytes, 2556 views)
File Type: sp Get Plugin or Get Source (namechangepunisher.sp - 2127 views - 4.8 KB)
File Type: smx namechangepunisher.smx (4.3 KB, 2072 views)
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 06-17-2014 at 16:17. Reason: Updated to version 1.1
Powerlord is offline