Raised This Month: $51 Target: $400
 12% 

Solved CSGO Player Names Conditions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
raj kaul
Senior Member
Join Date: Mar 2018
Location: www.lotgaming.xyz
Old 02-17-2022 , 09:55   CSGO Player Names Conditions
Reply With Quote #1

Hello guys
I wanted a player name(nick name) plugin with these conditions,

Quote:
1- Players can use max 12 words in their names ( remove extra words from name if they are using more then 12)
2 - automatically remove emojis or symbols from name (nicknames) , only alphabet and numbers are allowed
__________________

Last edited by raj kaul; 03-08-2022 at 13:12.
raj kaul is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-18-2022 , 12:24   Re: CSGO Player Names Conditions
Reply With Quote #2

Could you add some examples of strings you not want in player names.

https://regexr.com/6fon5 old
regexr.com/6fonh

- Add in big,center text area, doesn't matter where you add.
- Then click upper-left "Untitled" title and fork, you then get new link, share that link here.
__________________
Do not Private Message @me

Last edited by Bacardi; 02-18-2022 at 12:26.
Bacardi is offline
raj kaul
Senior Member
Join Date: Mar 2018
Location: www.lotgaming.xyz
Old 02-18-2022 , 20:32   Re: CSGO Player Names Conditions
Reply With Quote #3

@bacardi ty for your reply
actually I don't know what is this and how to use this ,I will try to explain in my comment here.

i am trying to limit player names for my game server, that's why i want few limitation,
they can use max 12 words , numbers and alphabets and _ ( underscore ) are allowed. if they are using space then it should be auto merge, ex- if Raj Kaul then it will look like RajKaul
all other things are blocked or auto removed

https://i.gyazo.com/ff2315cc26672c4d...136c1488c5.png

check this image he is using emoji , i want to remove that too
__________________
raj kaul is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-19-2022 , 05:38   Re: CSGO Player Names Conditions
Reply With Quote #4

You need space, to make words.

Do you mean max. 12 letters in names?
__________________
Do not Private Message @me
Bacardi is offline
raj kaul
Senior Member
Join Date: Mar 2018
Location: www.lotgaming.xyz
Old 02-19-2022 , 07:19   Re: CSGO Player Names Conditions
Reply With Quote #5

yes 12 max
__________________
raj kaul is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-19-2022 , 11:44   Re: CSGO Player Names Conditions
Reply With Quote #6

Not sure how good is this.

- Regex pattern is [^a-zA-Z\d,._-]
  • All simple letters a to z.
  • All numbers 0 to 9.
  • Comma ,
  • Dot .
  • Underscore _
  • Hyphen -

- When removing not wanted character from player name, it get shorter or even empty.
Game set player empty name "unnamed" automatically, but this plugin change empty name to:
id_<userid> , example "id_53"

- out of topic. You can target player with userid, if you did not know. sm_kick #53 Bye

- Player name longer than 12 bytes is getting cut to 12 bytes.

*edit
You can enable debug_log mode by editing plugin source code:
Code:
#define DEBUG_ENABLE true // change false to true to start logging name replace, into sourcemod logs
Attached Files
File Type: sp Get Plugin or Get Source (test.sp - 65 views - 3.6 KB)
__________________
Do not Private Message @me

Last edited by Bacardi; 02-19-2022 at 11:45.
Bacardi is offline
raj kaul
Senior Member
Join Date: Mar 2018
Location: www.lotgaming.xyz
Old 02-19-2022 , 15:59   Re: CSGO Player Names Conditions
Reply With Quote #7

thank you so much , this plugin is working fine for me.
I will test more and get back to you .
__________________
raj kaul is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-19-2022 , 16:26   Re: CSGO Player Names Conditions
Reply With Quote #8

Nice to hear
Good
__________________
Do not Private Message @me
Bacardi is offline
raj kaul
Senior Member
Join Date: Mar 2018
Location: www.lotgaming.xyz
Old 03-08-2022 , 07:17   Re: CSGO Player Names Conditions
Reply With Quote #9

Quote:
Originally Posted by Bacardi View Post
Nice to hear
Good
hey Bacardi thank you so much for your help, tested this plugin for 10-15 days and its working very well for my servers

just wanted to add one more thing in chat where players can see if their names are changing .
ex- x xx @ your name changed to xxx bcz you are using special text in your name
__________________
raj kaul is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 03-08-2022 , 08:10   Re: CSGO Player Names Conditions
Reply With Quote #10

Try edit source code
then compile it to plugin.
PHP Code:
...    
    if(
NameChanged[client])
    {
        if(
IsClientInGame(client))
        {
            
PrintToChat(client" \x03[SM] '%N' your name changed to '%s' because you are using special characters in your name."clientname);
        }
        
        
SetClientName(clientname);
    }
}
... 

web compiler
https://www.sourcemod.net/compiler.php
__________________
Do not Private Message @me

Last edited by Bacardi; 03-08-2022 at 08:12.
Bacardi is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:45.


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