AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Protect Names (https://forums.alliedmods.net/showthread.php?t=189096)

Exolent[jNr] 07-03-2012 12:18

Protect Names
 
1 Attachment(s)
Protect Names
v0.0.2, by Exolent



Description:

This plugin allows you to protect player names so that other players cannot fake that name.

Don't get this idea confused with Restrict Names.
That plugin blocks names from being used at all, whereas this one protects names to specified players.

This already exists in the default AMXX, but it requires you to set passwords for players and doesn't allow them to be matched to a SteamID among other options that this plugin offers.
This plugin does not deal with passwords (if you want passwords, just use AMXX's method).

It allows you to restrict a name based on one of the following:
  • SteamID
  • IP
  • admin flags

For matching a name to be restricted, you can match it by:
  • equaling the name
  • containing the name (like a tag for example)
  • or a regular expression


Requirements:
  • AMX Mod X 1.8.0 or higher
  • RegEx module
  • Fakemeta module


Cvars:
  • protect_name_punish 0/1
    - 0 = Rename player to replacement name from file
    - 1 = Execute command from protect_name_command cvar (kick or ban).
    - Default: 0
  • protect_name_command "command"
    - Command executed on server when player is punished (when protect_name_punish is 1)
    - Allows formatting with variables:
    • %name% - The name that player tried using
    • %steamid% - The SteamID of the player
    • %userid% - The userid of the player
    • %ip% - The IP of the player
    • %reason% - The reason from protect_name_reason cvar
    - To use double quotes in this cvar, use \' and they will be replaced to "
    - Default: "kick %userid% \'%reason%\'"
  • protect_name_reason "reason"
    - Reason printed to player in chat if no punishment is taken.
    - Allows formatting with variables:
    • %name% - The name that player tried using
    • %steamid% - The SteamID of the player
    • %userid% - The userid of the player
    • %ip% - The IP of the player
    - Default: "%name% is protected and you are not allowed to use it!"


File Setup:

File is located at addons/amxmodx/configs/protect_names.ini

Format of the file is as follows:
Code:

// Lines starting with // or ; are comments and are ignored in the file
; This is a comment, too!
//
// File format:
// "match type" "string to match" "restrict type" "restricted string" "replacement"
//
// Available match types:
// equal
// equali
// contain
// containi
// regex/flags (eg. regex/i)
//
// When using "regex" match type, the pattern goes in the match string.
//
// Available restrict types:
// steam, steamid
// ip, address, ipaddress
// flag, flags
//
// Remember, match types and restrict types are case insensitive, so RegEx and SteamID will also work.
//
"containi" "Exolent" "steamid" "STEAM_0:1:23456" "Imposter alert!"
"regex/i" "j(uke)?Nr(un)?" "flags" "m" "Fake member"


Changelog:
  • 0.0.2
    - Fixed backwards IP/SteamID restriction
    - Updated name change for new access flags detection
  • 0.0.1
    - Initial release

Groven 07-03-2012 13:07

Re: Protect Names
 
Nice, Will be using!

Aooka 07-03-2012 17:14

Re: Protect Names
 
Nice job !

Liverwiz 07-04-2012 10:57

Re: Protect Names
 
Dude....this is awesome.

What about a feature that checks the exclusion of a tag or something.
i.e. an admin connects that doesn't have the tag on, and the plugin then changes it to a default string.

Xalus 07-04-2012 17:36

Re: Protect Names
 
Quote:

Originally Posted by Liverwiz (Post 1743216)
Dude....this is awesome.

What about a feature that checks the exclusion of a tag or something.
i.e. an admin connects that doesn't have the tag on, and the plugin then changes it to a default string.

I don't think thats the best idea..
Sometimes U wanna be "undercover" admin,
to see with ur own eyes that someone is rulebreaking or anything else.

Liverwiz 07-04-2012 17:57

Re: Protect Names
 
Quote:

Originally Posted by Xalus (Post 1743441)
I don't think thats the best idea..
Sometimes U wanna be "undercover" admin,
to see with ur own eyes that someone is rulebreaking or anything else.

I agree. But sometimes server owners also want to enforce everyone wear the tag. It all depends on the server. And, of course, allow the OP to choose.

Moody92 07-06-2012 06:04

Re: Protect Names
 
Nice plugin but,

Can I know the difference between [ equal ] and [ equali ], [ contain ] & [ containi ]

EDIT : Nevermind, got the meaning from http://www.amxmodx.org/funcwiki.php?go=inc&id=5

EDIT2 : Well, I think it doesn't work I added this line
HTML Code:

"equal" "Anonoymous" "steamid" "STEAM_0:0:35493476" "Fake guy"
It's changed my name to fake guy :P

HTML Code:

* [PN] Anonymous is protected and you are not allowed to use it!
* Anonymous changed name to Fake guy

Status
HTML Code:

# 5 "Anonymous ?" 220 STEAM_0:0:35493476  0 05:51  179   
Have I done anything wrong ?

xPaw 07-06-2012 06:45

Re: Protect Names
 
Moody92, you showed perfectly fine working example. You need to understand difference between match types.

Moody92 07-06-2012 10:31

Re: Protect Names
 
That's what i was looking for,
If there are [ i ] that's mean case insensitive, What is insensitive case ? I didn't understand this point.

Exolent[jNr] 07-06-2012 10:37

Re: Protect Names
 
Quote:

Originally Posted by Moody92 (Post 1744491)
Nice plugin but,

Can I know the difference between [ equal ] and [ equali ], [ contain ] & [ containi ]

EDIT : Nevermind, got the meaning from http://www.amxmodx.org/funcwiki.php?go=inc&id=5

EDIT2 : Well, I think it doesn't work I added this line
HTML Code:

"equal" "Anonoymous" "steamid" "STEAM_0:0:35493476" "Fake guy"
It's changed my name to fake guy :P

HTML Code:

* [PN] Anonymous is protected and you are not allowed to use it!
* Anonymous changed name to Fake guy

Status
HTML Code:

# 5 "Anonymous ?" 220 STEAM_0:0:35493476  0 05:51  179   
Have I done anything wrong ?

I don't fully understand your example there.

Quote:

Originally Posted by Moody92 (Post 1744638)
That's what i was looking for,
If there are [ i ] that's mean case insensitive, What is insensitive case ? I didn't understand this point.

Case sensitive means that the letters have to match case (uppercase, lowercase), meaning "Exolent" does not match "exolent".
Case insensitive means that the letters do not have to match case, meaning "Exolent" matches "exolent".


All times are GMT -4. The time now is 04:33.

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