Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

RSSUltimate Change Your Name


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
68747470733a2f2f692e696d6775722e636f6d2f

Welcome.

Change Your Name is a plugin that allows you to change your name in-game independently of your Steam name (and much more!). This version replaces and supercedes Set My Name, which is now considered obsolete/out-of-date.

As a player, change your name to anything you would like, reset any time or see if another player has changed their name! Have the fun you deserve with options!

As an admin, control the names you want to keep out of your server! Prevent players from changing their names at all! Force lock a name on a player! Rename your players with an updated rename command! Or have some fun from time to time by randomizing somebody’s name! A lot of options to keep bad actors at bay!

Plugin comes with statistics and a full admin command suite for server administrators with no SRCDS access.

68747470733a2f2f692e696d6775722e636f6d2f

Change Your Name has a lot of commands. Most of them sets up how the plugin behaves. Default values should work fine. You will find sm_name.cfg in cfg/sourcemod where values can be configured.

ConVars
  1. sm_name_version - Displays the current version of the plugin. (1.7.0.1963)
  2. sm_name_help_enable 0/1 - Displays/Hides [NAME] This server allows name changes. Type !nhelp for more information message when players connect to the server. [Default: 1]
  3. sm_name_enable 0/1 - Enables/Disables plugin. [Default: 1]
  4. sm_cname_enable 0/1 - Enable/Disable the ability to change name. [Default: 1]
  5. sm_oname_enable 0/1 - Enable/Disable fetching the name players had when they connected to the server. [Default: 1]
  6. sm_sname_enable 0/1 - Enable/Disable fetching players Steam name. [Default: 1]
  7. sm_srname_enable 0/1 - Enable/Disable resetting to Steam name. [Default: 1]
  8. sm_name_ban_time <time in minutes> - Defines the behavior or the ban time if a player joins the server with a banned name.
    -2 -> Removes their name [Default]
    -1 -> Kicks player
    0 and above -> Bans player (time in minutes)
  9. sm_name_ban_reason <reason> - Defines the kick message. [Default: [AUTO-DISCONNECT] This name is banned from being used. Please change it.] [CSGO: AUTOKICK - Banned player name detected. Please change it]
  10. sm_name_cooldown <time in seconds> - Defines the amount of time a player has to wait before being able to change their name again. Time in seconds, but formatted in MM:SS in-game. [Default: 30 seconds]
  11. sm_name_bannednames_checker 0/1 - Defines whether players names will be checked against banned_names.ini [Default: 1]
  12. sm_name_bannedids_checker 0/1 - Defines whether players SteamID will be checked against banned_id.ini [Default: 1]
  13. sm_rename_cooldown <time in seconds> - Defines how long a player will have to wait before changing their name again after an admin has renamed them. Time in seconds, but formatted in MM:SS in-game. [Default: 600 (10 minutes)]

The following ConVars are for debugging purposes. When turned on, they will log information into logs/NameChanger. Please note that debugging mode will turn itself off on map end or on server restart.
  1. sm_name_debug 0/1 - Enable/Disable debug mode. [Default: 0]
  2. sm_name_debug_sound 0/1 - Enable/Disable sound notification when debug mode is enabled/disabled. [Default: 1]
  3. sm_name_debug_snd_on <sound file> - Defines the sound to use relative to the sounds folder whenever debug mode is turned on. [Default: hl1/fvox/bell.wav] [CSGO: training/bell_normal.wav] [L4D/L4D2: buttons/bell.wav]
  4. sm_name_debug_snd_off <sound file> - Defines the sound to use relative to the sounds folder whenever debug mode is turned off. [Default: hl1/fvox/beep.wav] [CSGO: buttons/combine_button_locked.wav] [L4D/L4D2: buttons/blip1.wav]

Note: You may have to manually set debug sounds for the game you run this plugin on.

Admin Commands
  1. sm_name_ban <name to ban> - Name to ban. Do not put white spaces — “Bananas” is valid, but “I hate bananas” is not. More information below.
  2. sm_name_unban <name to unban> - Name to unban.
  3. sm_name_banid <SteamID to ban> - SteamID to ban. It must be a Steam 2 ID format. More information below.
  4. sm_name_reload - Reloads files storing banned names and SteamIDs.
  5. sm_rename <#userid|name> <new name> - Renames a player. You must use quotes if the new name has white spaces. You must also replace playercommands.smx with the new version posted here. It disables the standard sm_rename from SM.
  6. sm_name_random <#userid|name> - Randomizes a player’s name.
  7. sm_name_force <#userid|name> <new name> - Forces a new name on a client. They will not be able to change their name through sm_name or sm_srname or even on Steam.
  8. sm_name_unforce <#userid|name> - Removes a forced locked name.
  9. nameadmin <command> [argument] - Main administration interface for plugin. Explained below.

The command nameadmin allows your server administrators to view plugin statistics, such as overall number of name changes, resets, queries, etc. In addition to plugin statistics, you can also check individual player statistics, providing the same amount of information. Finally, it allows them to restart the plugin should the plugin run into issues for any reason.
  • nameadmin - Displays the available commands.
    1. nameadmin cmd - Displays arguments you can use with “cmd”.
      • nameadmin cmd list - Displays a list of available cmds.
      • nameadmin cmd <cmd name|#cmd> - Displays info on a specific cmd.

    2. nameadmin cvar - Displays arguments you can use with “cvar”.
      • nameadmin cvar list - Displays a list of available cvar.
      • nameadmin cvar <cvar name|#cvar> - Displays info on a specific cvar.

    3. nameadmin plugin - Displays the arguments you can use with “plugin”.
      • nameadmin plugin info - Displays general plugin info.
      • nameadmin plugin stats - Displays precise plugin statistics.
      • nameadmin plugin reload - Reloads the plugin the same way sm plugins reload <file> would. Please note that this wipes previously stored information in memory and thereby, will prevent players from using the plugin until the map has reloaded/changed.
      • nameadmin plugin reload map_reload - Reloads the plugin the same way sm plugins reload <file> would and reloads the map to refresh information stored in memory.

      Note: Anytime the plugin is unloaded or reloaded, the latest statistics are printed into the server console and dumped into Sourcemod's logs.

    4. nameadmin player - Displays the arguments you can use with “player”.
      • nameadmin player status - Displays all the connected players in a list with necessary information.
      • nameadmin player status <#userid|name> - Displays player name statistics.

  • nameadmin credits - Displays detailed credits listing.

  • nameadmin version - Displays detailed plugin version.

The following is taken from banned_names_example.ini. Check this file again if you need to review instructions.
Code:

Adding banned names manually to file instructions:

To add a name, simply type the name you want to have banned. YOU MUST ADD A NEW BLANK LINE AFTER THE LAST NAME! NAMES CANNOT HAVE WHITE SPACES!
Banned names will be read on server restart, next map or by manually reloading files through sm_name_reload.

A banned name means that if the banned name is found anywhere in somebody's player name, the entire name gets removed (or the player is kicked based on your server settings) i.e. if you ban the name "Apple", if a player is named "Apple is the best fruit", the entire name will be removed (or the player will be kicked). Be careful with the names you ban as this could quickly lead to undesired effects.

MAXIMUM NUMBER OF BANNED NAMES IS 255!

ADMINS ARE IMMUNE TO NAME BANS!

EXAMPLES:

Valid examples:

        Snowflake
        Sucker
        Clown

Invalid example (DO NOT DO THIS):

        I hate bananas -> Invalid due to white spaces used
       
Do not add any comment behind a name, as this will mess the file up if you use sm_name_unban later on, plus, there is no guarantee the name will be read properly. Play it safe.

The following is taken from banned_ids_example.ini. Check this file again if you need to review instructions.
Code:

READ THIS FILE CAREFULLY, AS IT EXPLAINS HOW TO USE IT AND HOW BANNED STEAM IDS ARE STORED.

To add a Steam ID, simply type the Steam ID in a Steam 2 ID format (beginning with STEAM_0:). YOU MUST ADD A NEW BLANK LINE AFTER THE LAST STEAM ID! DO NOT ADD ANY EXTRA INFORMATION BEHIND THE STEAM ID!
Banned Steam IDs will be read on server restart, next map or by manually reloading files through sm_name_reload.

MAXIMUM NUMBER OF BANNED STEAM IDs IS 255!

ADMINS ARE IMMUNE TO STEAM ID BANS!

EXAMPLES:
       
        STEAM_0:1:012345678
        STEAM_0:1:876543210
       
Again, do not add any comment behind a SteamID. It is common to add the name that is tied to the SteamID, but this will mess the file up if you use sm_name_unbanid later on, plus, there is no guarantee the SteamID will be read properly. Play it safe.

Public Commands
  1. sm_name <new name> - Change your name to a new name. Quotes are NOT required.
  2. sm_oname <#userid|name> - Fetches the name a player had when they connected to the server.
  3. sm_sname <#userid|name> - Fetches the Steam name of a player.
  4. sm_srname - Resets your current name to your Steam name.
  5. sm_nhelp - Prints public commands to the console.
  6. sm_name_credits - Prints credits listing to the console.

68747470733a2f2f692e696d6775722e636f6d2f

This plugin does not require any third-party plugins or extensions to function, except for Half-Life 2: Deathmatch.

=============================================
FOR HL2DM USERS: YOU MUST INSTALL player model fix plugin to fix a bug with cl_playermodel.
=============================================

Plugin can be automatically updated through Updater by GoD-Tony, but it is not required for this plugin to function.

For developers

If you need to recompile the plugin for any reason, the only include that is not Sourcemod standard issued is Unix time.

68747470733a2f2f692e696d6775722e636f6d2f

To install this plugin:
  1. Download the ZIP in the attachment below.
  2. Extract the ZIP anywhere you would like.
  3. Inside the Plugins folder, you will find a number of folders corresponding to some games. As their names suggest:
    • For Counter-Strike: Global Offensive -> Open folder Counter-Strike Global Offensive and copy the contents inside of it into your Counter-Strike Global Offensive's SRCDS directory (e.g. C:\SteamCMD\csgo\csgo)
    • For Half-Life 2: Deathmatch -> Open folder Half-Life 2: Deathmatch and copy the contents inside of it into your Half-Life 2: Deathmatch's SRCDS directory (e.g. C:\SteamCMD\hl2mp\hl2mp)
    • For Left 4 Dead 1 and 2 -> Open folder Left 4 Dead 1 & 2 and copy the contents inside of it into your Left 4 Dead's or Left 4 Dead 2's SRCDS directory (e.g. C:\SteamCMD\l4d\l4d)
    • For all other Source engine games not listed above, open folder General and copy the contents inside of it into your game's SRCDS directory of your choice:
      • For Counter-Strike: Source -> e.g. C:\SteamCMD\css\cstrike
      • For Team Fortress 2 -> e.g. C:\SteamCMD\tf2\tf
      • Etc.
If you would like a no color version (no colored text in chat), copy and paste the contents from folder General No Color into your game’s SRCDS directory of your choice.

Tested games
  • Counter-Strike: Global Offensive
  • Counter-Strike: Source
  • Half-Life 2: Deathmatch
  • Left 4 Dead 2
  • Team Fortress 2

Note: Despite my best efforts, I could not test the plugin on Left 4 Dead 1. I was stuck on the loading screen when connecting to my server, and it would not budge. That or I would get a black screen. If this is anything to go by, Left 4 Dead 2 was working fine for me, so did the plugin, so I will assume it is working fine in Left 4 Dead 1 as well. If not, let me know what is going on.

Please make sure to use the correct version for the game you run a SRCDS server for. Failsafes are in place to ensure that. Do not try to use the no color version on CSGO, HL2DM or L4D as they will not work. It is possible to create a no color version for those games if there is demand for it.

68747470733a2f2f692e696d6775722e636f6d2f
  • Plugin latest compile: 09/26/23
  • Plugin latest version: 1.7.0.1963
  • Compiled on Sourcemod version: 1.11.0.6936
  • Plugin tested on local servers running: Windows 10 x64
  • Linux status: Unknown
  • MacOS status: Unknown

This plugin will not run on previous versions of Sourcemod.
It is unknown if plugin runs fine or at all on 1.12.0.7047

68747470733a2f2f692e696d6775722e636f6d2f

Counter-Strike: Global Offensive
Spoiler


Counter-Strike: Source
Spoiler


Half-Life 2: Deathmatch
Spoiler


Left 4 Dead 2
Spoiler


Team Fortress 2
Spoiler


Latest plugin statistics dumped on plugin unload/reloaded in the SRCDS dedicated console
Spoiler


68747470733a2f2f692e696d6775722e636f6d2f

Before posting, make sure that:
  • You are using the latest stable build of Sourcemod.
  • That the problem is clearly from this plugin and not another one. If conflicts arise from another plugin, let me know, and I will look into solutions.
  • That the issue can be consistently reproduced.

If you run into issues with the plugin:
  • Turn on debug mode and see what is happening.
  • Restart server.
  • Reinstall plugin.
If all fails, for the best possible assistance, provide your Sourcemod version, screenshots/videos of the issue(s), steps to reproduce.

68747470733a2f2f692e696d6775722e636f6d2f
  • It is possible that if you rename a player while he is on cooldown after using !name or srname, some seconds might be skipped on the admin rename cooldown. It is recommended to keep sm_name_cooldown to a low value (default is 30 seconds, which is best for most servers) and sm_rename_cooldown to at least 300 seconds (5 minutes) (default 600 seconds — 10 minutes).

68747470733a2f2f692e696d6775722e636f6d2f
  • Add sm_name_reset <#userid|name> - Resets a player’s name to their Steam name.
    Currently did not feel like adding it, because it is the same as doing !sname <#userid|name> and !rename <#userid|name> <new name>, even if currently, it requires 2 commands.
  • Add sm_name_history <#userid|name> to display their latest names used.
  • Create a separate plugin version with MySQL support (pretty large thing to do, no guarantee it will ever be made if there is no demand for it).
  • sm_permaname <new name> - Sets a name and will be set every time a player joins the server.
  • sm_permaname_remove - To remove a permanently set name.
  • Allow for customizing the tag. This is so that servers can be more homogenous when other plugins are used.
  • Allow for customizing colors.

68747470733a2f2f692e696d6775722e636f6d2f

Q: Can this run on Source 2?
A: Unknow at this time. I would like to wait and see where Counter-Strike 2 is headed before making large decisions.

Q: There is a game I want to run this on, but it does not work.
A: If it is running on Source, name the game. I will definitely look into it to make it compatible if I can.

Q: Can you make this available on AMX?
A: Unlikely.

Q: What is the difference between !oname and !sname anyway? Why not use one?
A: They both differ in their own way. When you connect to the server, your name you connect with is stored in memory. If you change your Steam name, that name that was stored does not change. This could still be useful for admins for catching bad actors who joined with a bad name for example. !sname will always fetch the Steam name you currently have.

Q: Plugin is conflicting with plugin X. Can you fix it?
A: Depends on the nature of this conflict. If it is caused by my plugin, then I will look into it.

Q: Can you add feature X?
A: Maybe. If the feature makes sense for this plugin, I might consider it for a future update.

Q: Why does HL2DM require an extra plugin? Could it not work without it?
A: It can technically work without the player model fixer, but you would be running into issues with servers that have mp_teamplay set to 1. As a precaution, you need to use the player model fix.

Q: Could you make a feature where a player cannot take the name used by another player? Can you make VIP names?
A: I looked into it, but concluded this is too risky to implement and here is why. Player names are not unique and if I start doing things like preventing a player from using a name, because another is using the same name, it is going to cause a huge conflict in the long run, even as an option you could enable/disable.

Q: Can you adapt the plugin for my server?
A: If I start doing this, I am probably never going to see the end of it. One of the major goals of this plugin was to provide options. If it is lacking something you want, post a suggestion below.

Q: Why does your code look horrible?
A: I am not an experienced Sourcemod coder and this is my first large project so to speak. I continued off of the previous code that I had made back 2018, when I was learning Sourcemod from scratch. I would like to re-visit this in the future and optimize the code. Right now, things work as they should.

Q: I use Updater by GoD-Tony, do I need to download new versions here as they release?
A: No. I will ensure that if you use Updater, you will not have to worry about manually updating anything.

Q: Is there a more minimalistic version?
A: There is always eyal282’s version at your disposal. I can eventually look into providing individual modules if there is enough demand for it.

Q: Do you have a Github repository?
A: Yes! Plugins can be found on Github here.

Attached Files
File Type: zip Plugins.zip (418.2 KB)

Wyświetl pełny artykuł

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...