Restrict Names 1.2a

This plugin will check a player's name when they enter the server and also if they change their name mid-game. It checks their name against a list of regex examples and if it matches any, the player will be punished as per the setting for that particular example (rename, kick, or ban).


The regex examples are kept in .\configs\restrictnames.ini and the sample file is setup to rename players named 'player', players with too short a name (2 or fewer characters), and players with too long a name (over 26 characters), kick players with racist or homophobic terms in their name, and ban players that have 'japs', a variation of 'mygot', or 'game-deception' in their name (both japs and mygot are popular hacking clans while 'game-deception' is a name used in a hack with rapid name change).


Name violations are recorded within the .\logs directory. One log file is created per month and is named in the format of restrictnamesMM.log where "MM" is the two-digit month number. The CVAR restnames_log_cnt can be used to set the number of log files to keep.



Installation

File Locations:

  • .\configs\restrictnames.ini
  • .\data\lang\restrictnames.txt
  • .\plugins\restrictnames.amxx
Required Modules:
  • fun
  • regex
Configuration Files

restrictnames.ini (collection of regex phrases to restrict)

Each line has the following elements:

  • It is the regex phrase that detects a restricted name.


    It is the text that is displayed to the user to indicate why they're being punished.


    It is the method used to punish a player.
    • 0: rename to value specified by restnames_default_name CVar, or the custom name indicated as 'NewName'
      1: kick the player
      2: ban the player

    It is only used if the punishment type is rename or ban. If 'punishmentType' is 0 (rename), punishmentOption must be the new name to give the player. If 'punishmentType' is 2 (ban), punishmentOption must be the ban length
Options (CVARS)

restnames_check_names <0|1>
Indicates if this plugin should check the names against the restriction list.
  • 0: Do not check the names.
    1: Check the names.
Default value is 1.

restnames_amxban <0|1>
Indicates method of banning players.
  • 0: ban via 'banid'
    1: ban via 'amx_ban' (use only if you have the amxbans plugin installed)
Default value is 0.

restnames_check_bots <0|1>
Indicates if this plugin should check the names of bots for violations.
  • 0: Do not check the bots.
    1: Check the names of bots.
Default value is 1.

restnames_log_cnt <0..11>
Specifies the number of previous month's logs to retain. The current month is always retained.

Default is 2 months.

restnames_immunity <0|1>
Indicates if players with the immunity flag are checked for name violations.
  • 0: check everyone
    1: check everyone except players with immunity flag
Default value is 0.

The immunity flag is set as ADMIN_IMMUNITY by default but can be changed in the script.



DOWNLOAD
Get Plugin or Get Source (restrictnames.sma - 13.3 KB)
restrictnames.txt
restrictnames.zip

0 comments:

Post a Comment