Rename players to prevent taking CLAN tag
Hi,
I use this easy script below to give admins a clantag. How can I modify this to prevent other players from using setinfo name CLANTAG playername The innitial idea was to hook playerrename, then string replace name and then rename player. After that rename the admins. That would cause the hook again and ends in a loop bc I set playername and fire rename player hook again. Another problem I had was when I hook playerrename I only see the oldplayer name with Format(strNickname, sizeof(strNickname), "%N", client); But you would need the new player name to do the string replace. Below is the old script with the attempt, below below is the new attempt that ends in mess. I guess it is the wrong approach... PHP Code:
PHP Code:
|
Re: Rename players to prevent taking CLAN tag
PHP Code:
|
Re: Rename players to prevent taking CLAN tag
PHP Code:
|
Re: Rename players to prevent taking CLAN tag
Oh that is almost the thing I need.
For some reason it is bugging out if an admin tries to rename himself. It adds the tag again, if you use utf8 character and rename 3 time LILAC kicks you bc of characters in name :D I guess you have to strip the TAG no matter what innitially to make sure its not already set. PHP Code:
|
Re: Rename players to prevent taking CLAN tag
I didn't really understand what was the problem, but here it is:
PHP Code:
|
Re: Rename players to prevent taking CLAN tag
So it looks like this now:
PHP Code:
setinfo name "test" the name stays old with ♛ in front if I do it a second time, I get the new name without ♛ Connect to server Name= [♛] Originalname setinfo name "TEST" Name= [♛] Originalname setinfo name "TEST" Name= TEST setinfo name "TEST" Name= TEST I would think it would strip the crown on player_changename and then readds it for admins but this does not happen. Thank you for your patience and work btw |
Re: Rename players to prevent taking CLAN tag
I wasn't even aware setinfo name "something" existed
Try changing your name the "normal" way: through Steam or sm_rename I'll investigate a bit further about that setinfo name thing |
Re: Rename players to prevent taking CLAN tag
After some testing, setinfo name is highly buggy and doesn't even properly change your username by default. It seems to enforce your current steam name when changed, even when I set it to something else.
The plugins is working fine when using sm_rename I will upload a quick fix for something I noticed PHP Code:
|
Re: Rename players to prevent taking CLAN tag
It seems to work now, normally admins don't tend to change their name anyways.
Thanks a lot for that! Btw the setinfo name "" is widely used by lots of trolls to impersonate people by copying their name and add a blank after the name. Lets say you have "player1" and then someone does setinfo name "player1 " it seems like you have two player1. Mostly done to avoid !kick player1 which may result in "multiple target error" output. Or it is just used to - well - change your name midgame to someting funny. |
Re: Rename players to prevent taking CLAN tag
Use players #userid for targeting, not names. (Look from console status).
!kick #59 |
All times are GMT -4. The time now is 16:43. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.