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

Kick client with ᅚᅚ (blank) name.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
midnight9
Senior Member
Join Date: Nov 2012
Old 09-09-2017 , 18:42   Kick client with ᅚᅚ (blank) name.
Reply With Quote #1

Hello, Im trying kick players with these characters ᅚᅚ as a name which makes their name blank.


I've tried something simple like this, but no luck:

PHP Code:
public OnClientPostAdminCheck(client){
    if(!
IsFakeClient(client))
    {
        new 
String:clientName[32];
        
GetClientName(clientclientNamesizeof(clientName));
        if(
StrContains(clientName"ᅚᅚ"))
        {   
            new 
String:reason[64]
            
GetConVarString(bnkb_reason,reason,64)
            
ServerCommand("sm_kick #%i %s"clientreason)
        }
    }        

Note: Its if(StrContains(clientName, "ᅚᅚ")) not if(StrContains(clientName, " "))

Any ideas?
midnight9 is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 09-09-2017 , 18:49   Re: Kick client with ᅚᅚ (blank) name.
Reply With Quote #2

Quote:
Originally Posted by midnight9 View Post
Hello, Im trying kick players with these characters ᅚᅚ as a name which makes their name blank.


I've tried something simple like this, but no luck:

PHP Code:
public OnClientPostAdminCheck(client){
    if(!
IsFakeClient(client))
    {
        new 
String:clientName[32];
        
GetClientName(clientclientNamesizeof(clientName));
        if(
StrContains(clientName"ᅚᅚ"))
        {   
            new 
String:reason[64]
            
GetConVarString(bnkb_reason,reason,64)
            
ServerCommand("sm_kick #%i %s"clientreason)
        }
    }        

Note: Its if(StrContains(clientName, "ᅚᅚ")) not if(StrContains(clientName, " "))

Any ideas?
Instead of using ServerCommand try:

PHP Code:
public OnClientPostAdminCheck(client){
    if(!
IsFakeClient(client))
    {
        new 
String:clientName[32];
        
GetClientName(clientclientNamesizeof(clientName));
        if(
StrContains(clientName"ᅚᅚ"))
        {   
            new 
String:reason[64]
            
GetConVarString(bnkb_reason,reason,64)
            
KickClient(clientreason)
        }
    }        

sm_kick calls KickClient, so ServerCommand adds redundant overhead.
SM commands that allow "#" prefix for targetting someone take a UserID, not a raw client index.
__________________
WildCard65 is offline
midnight9
Senior Member
Join Date: Nov 2012
Old 09-10-2017 , 05:33   Re: Kick client with ᅚᅚ (blank) name.
Reply With Quote #3

Quote:
Originally Posted by WildCard65 View Post
Instead of using ServerCommand try:

PHP Code:
public OnClientPostAdminCheck(client){
    if(!
IsFakeClient(client))
    {
        new 
String:clientName[32];
        
GetClientName(clientclientNamesizeof(clientName));
        if(
StrContains(clientName"ᅚᅚ"))
        {   
            new 
String:reason[64]
            
GetConVarString(bnkb_reason,reason,64)
            
KickClient(clientreason)
        }
    }        

sm_kick calls KickClient, so ServerCommand adds redundant overhead.
SM commands that allow "#" prefix for targetting someone take a UserID, not a raw client index.
I have changed it to KickClient but it made no difference. I thought maybe it doesnt recognize these ᅚᅚ characters so i tried with something simple as two letters aa but it doesnt do anything.
midnight9 is offline
root88
Senior Member
Join Date: May 2016
Old 09-10-2017 , 06:08   Re: Kick client with ᅚᅚ (blank) name.
Reply With Quote #4

https://sm.alliedmods.net/new-api/string/StrContains
if(StrContains(clientName, "ᅚᅚ") != -1)
__________________
root88 is offline
midnight9
Senior Member
Join Date: Nov 2012
Old 09-10-2017 , 06:52   Re: Kick client with ᅚᅚ (blank) name.
Reply With Quote #5

Quote:
Originally Posted by root88 View Post
https://sm.alliedmods.net/new-api/string/StrContains
if(StrContains(clientName, "ᅚᅚ") != -1)
Ah yes, thank you.
midnight9 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 09-10-2017 , 09:17   Re: Kick client with ᅚᅚ (blank) name.
Reply With Quote #6

...there are few invisible character ranges
When you block one, they change to another char...

What if check player names that they have few common ASCII characters included in name ?
__________________
Do not Private Message @me
Bacardi is offline
midnight9
Senior Member
Join Date: Nov 2012
Old 09-10-2017 , 15:44   Re: Kick client with ᅚᅚ (blank) name.
Reply With Quote #7

Quote:
Originally Posted by Bacardi View Post
...there are few invisible character ranges
When you block one, they change to another char...

What if check player names that they have few common ASCII characters included in name ?
I guess i will have to update it as i go. But it has allready filtered one of the players that i was suspecting of using exactly the same characters.
midnight9 is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 09-10-2017 , 18:21   Re: Kick client with ᅚᅚ (blank) name.
Reply With Quote #8

This might be useful.
__________________
Neuro Toxin 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 17:06.


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