View Single Post
Author Message
cmptrwz
Member
Join Date: Dec 2008
Old 03-13-2010 , 22:11   Color Code Cleanup
Reply With Quote #1

I got sick and tired of seeing the stupid color codes (those ^# things) for COD in names in TF2.

Thus, this plugin.

Has one setting:

sm_colorcodecleanup_threshold

Defaults to 1, as in 1 color code allowed in the name. Set to 0 to strip a name of color codes no matter what. I left it at one because I could see someone trying to make a face or something in their name using ^ followed by a number, like 0 or 8.

Tested in a limited fashion. It calls the sm_rename command (which should be part of playercommands, alongside slap and slay) for the client, as I didn't want to copy/paste/have to keep updating that code.

It should work in any game that sm_rename does.

If someone has all color codes for a name for some reason it will name them Unnamed.

EDIT: Version 0.2, should be a bit of an efficiency improvement on figuring out the new name, and throws an activity line in.

EDIT: Version 0.3, use the player_changename event instead of OnClientSettingsChanged (Benefit of it only fires when the name changes, compared to on #Name_change_limit_exceeded and other minor changes), but still has timers (INTENTIONALLY, FOR GOOD REASON, SEE POST A COUPLE DOWN)
Attached Files
File Type: sp Get Plugin or Get Source (colorcodecleanup.sp - 1829 views - 3.7 KB)

Last edited by cmptrwz; 03-16-2010 at 16:33.
cmptrwz is offline