AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [Any] Target Name Changers (https://forums.alliedmods.net/showthread.php?t=219956)

ddhoward 07-05-2013 06:44

[Any] Target Name Changers
 
This plugin has two simple functions:
  1. Displays Information:
    Whenever a client changes his/her name, other clients are given certain information through the console. This can help in targeting hackers who rapidly change their names to mimic other users. Information includes:
    • The old name
    • The new name
    • The user's Steam ID
    • The user's userID, which can be used to target the player through commands (sm_kick #213, for example)
    • The user's IP address

    Clients who have access to the override "sm_namechangeinfo_seeip" will see all the information, including the IP address. If the override does not exist, the BAN flag is used instead.

    If a client does not have access to that override (or the BAN flag), he will be given all information other than the IP address. The information can be blocked to clients entirely through the override sm_namechangeinfo.
  2. Facilitates Targeting:
    The plugin generates two new targeting filters, similar to @all, @alive, @humans, @me, etc. These can be used with almost any Sourcemod command that supports targeting.
    • @namechanger - Targets the last player who changed his/her name. If the player who occupies this label leaves the game, this filter will not target anyone until someone else changes their name.
    • @namechangers - Targets players who have changed their names X times, with each rename being no more than Y seconds apart, and the most recent rename being within the past Y seconds. (X = sm_namechangeinfo_count, Y = sm_namechangeinfo_time)
    • @recentnamechangers - Targets players who have changed their names within the past X seconds, where X is defined by the cvar sm_namechangeinfo_time

    FOR EXAMPLE:
    • sm_kick @namechanger "don't hack on my server" - Kicks the player who last changed his name with the reason "don't hack on my server"
    • sm_slay @recentnamechangers - slays players who've changed names recently
    • sm_slay @namechangers - slays players who've been changing their names a lot very recently
    • sm_ban @namechanger 0 "hacker douchebag" - Permabans the player who last changed his name.
      etc, etc, etc

    Please note that plugins that rename players (such as Free2BeRenamed, SteamRep Checker, the stock sm_rename command, etc.) will also trigger the functions of this plugin. The plugin is unable to distinguish between actual Steam name changes, hacked name changes, or name changes triggered by another plugin. Please keep this in mind when using the targeting filters. You don't want to accidentally punish the wrong user.


CVARS
  • sm_namechangeinfo_update 2 - Controls Updater compatibility
    • 0 : Completely disables Updater integration
    • 1 : Updater will notify you in Updater.log if an update becomes available.
    • 2 : Updater will automatically download any updates. They will be installed on the next server start or map change.
    • 3 : Updater will automatically download and immediately install any updates. This WILL cause the plugin to restart, meaning that all targeting filters will be "reset" as if no one has yet changed their name.

  • sm_namechangeinfo_destination 1 : (0/1/2/3) Where should the information be printed to?
    • 0 : Nowhere, the information is only used in the target filters.
    • 1 : Print the information to players' consoles.
    • 2 : Print the information to players' chat.
    • 3 : Print the information to both the console and the chat.
    Please note that on some games/mods, that which is sent to the chat also shows up in the console. On these games, setting this CVAR to 2 makes it seem like it was set to 3, and actually setting it to 3 causes the information to show up twice in the console.

  • sm_namechangeinfo_time 60.0 : (Any positive value) How many seconds since a player's last name change is he considered a name changer to be included in @recentnamechangers?

  • sm_namechangeinfo_count 3 : (Any positive value) How many times must a player change his name (with each time being no more than sm_namechangeinfo_time seconds apart) to be included in @namechangers ?



The plugin requires the updater.inc and ddhoward_updater.inc includes. As such, it does not compile here on the forums. You can either download and install the attached SMX, or download the SP and compile it yourself.




Downloads:

If you like what you see here, please consider donating~
http://www.paypalobjects.com/en_US/i..._donate_SM.gif

lyric 07-05-2013 08:54

Re: [Any] Name Change Info
 
amazing idea thanks for this!

RedSword 07-05-2013 11:54

Re: [Any] Name Change Info
 
Code:

hcvar_version = CreateConVar("sm_namechangeinfo_version", PLUGIN_VERSION, "Friendly Mode Plugin Version", FCVAR_DONTRECORD|FCVAR_NOTIFY|FCVAR_CHEAT|FCVAR_PLUGIN);
D:

Beside that, plugin looks ok (and good idea to give intel @ name changing, rather than preventing/kicking the client). Approved.

ddhoward 07-05-2013 13:36

Re: [Any] Name Change Info
 
Uploading new version 13.0705.2. It will shortly replace the version in the first post, and has been pushed to the Updater server. Changes are:
  • Changed a few strings from new to decl

  • Fixed version cvar description, no longer calls itself the Friendly Mode plugin

  • ADDED CVAR: sm_namechangeinfo_destination with default value of 1
    • 0 = Disabled
    • 1 = Print information to the console
    • 2 = Print information to the console and to chat

  • Added MultiTargetFilter "@namechanger". This can be used in almost any Sourcemod command with targeting, and will target the player who last changed his name. For example, running "sm_slay @namechanger" will slay the player who last changed his name. Running "sm_freeze @namechanger 999" will freeze the last person to change his name, for 999 seconds. Etc.

  • Added MultiTargetFilter "@namechangers". Similar to the above filter, this can be used to target players in pretty much any decently coded command with targeting. This filter targets any players who have changed their names within a given number of seconds, set by the new cvar sm_namechangeinfo_time (default value = 60.0)

Please let me know if you run into any issues. Please also consider installing Updater if you haven't already!

captaindeterprimary 07-05-2013 14:14

Re: [Any] Name Change Info
 
This is brilliant.

ddhoward 07-05-2013 14:50

Re: [Any] Name Change Info
 
Updated to 13.0705.3. Previous version had a dumb oversight where sometimes @namechanger would target client 0.

RedSword 07-05-2013 16:05

Re: [Any] Name Change Info
 
Hi again,

Be careful when using
Code:

decl String:steamID[20], String:ipAddress[16], String:oldName[33], String:newName[33];
Both GetClientIP and GetClientAuthString can return false. Sometimes a client can bypass the authorization, meaning he doesn't have a steamId (or possibly a spoofed one); meaning you'll get a random value, as you do not force-null the first char. I recommend doing ipAddress[0] = '\0' and steamID[0] = '\0' after their declaration.

Red

ddhoward 07-05-2013 16:27

Re: [Any] Name Change Info
 
Like this? I'm assuming that I wouldn't have to make any other changes to the code.

PHP Code:

decl String:steamID[20], String:ipAddress[16], String:oldName[33], String:newName[33];
ipAddress[0] = '\0';
steamID[0] = '\0'

EDIT: Actually, I can probably just use the returns of the two functions to decide on whether or not to even print the information.

ddhoward 07-05-2013 17:17

Re: [Any] Name Change Info
 
Updating to version 13.0705.4. Changes include:
  • Plugin now appropriately ignores clients who are not completely in-game.
  • Plugin now appropriately ignores SourceTV and Replay bots.
  • Added cvar sm_namechangeinfo_ignorebots. When enabled, bots who experience name changes will not have their information printed, will not replace the current occupant of @namechanger, and will not be included in @namechangers.
  • If a name-changed bot's information is printed, the SteamID and IP fields will say "BOT."
  • If a client's SteamID or IP cannot be verified, the fields will say "UNKNOWN."
  • Plugin does not print the information to the chatboxes/consoles of bots.

RedSword 07-05-2013 20:59

Re: [Any] Name Change Info
 
Code:

hcvar_destination = CreateConVar("sm_namechangeinfo_destination", "1", "(1/2/3) Where should the information be printed to? 0 = disabled, 1 = Console, 2 = Chat and Console", FCVAR_PLUGIN);
You mean (0/1/2) *

But It would be easy for you to do a 0/1/2/3 mod. Using bit operation '&' rather than '==' (and you already checking both; you could use else if; if you don't want to use '&' that is). That way someone could print to chat directly (which I'm surprise you aren't offering; you plugin says 'any' and I believe not all game display name change in chat or not)


All times are GMT -4. The time now is 11:55.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.