players containing number nicks?

Started by Nihongo^, Jul 24, 2023, 04:21 PM

Previous topic - Next topic

Nihongo^

How do I kick players containing number nicks?
And nicks with weird symbols ( ,,,' ''''' """" )

Nihongo^

Thanks btw I made this.

Quotelocal nickcheck = ( player.Name.len() < 4 ) || IsNum(player.Name)
    if (nickcheck) {
       
        print("nick not allowed");
    }

how do i include symbols players like such nick (```` ;;;; '''' ) joined every time

habi

Quote from: Nihongo^ on Jul 24, 2023, 04:21 PMHow do I kick players containing number nicks?
And nicks with weird symbols ( ,,,' ''''' """" )
My Answer: The four characters ( , ), ( ' ), ( " ) and ( ` ) gets replaced by _ when player is connecting to server.
As vito said, some players use 4 for A and so on.
If the name contain more than 4 digits, you can kick him
local c=0;
for(local i=0;i<player.Name.len();i++)
{
  if(player.Name[i]>='0'&& player.Name[i]<='9')
  c++;
}
if(c>=4)
{
  MessagePlayer("Invalid Nick. Connect with  proper nick.", player);
  if(!rawin("KickById")
    KickById<-function(id){  if( FindPlayer( id ) ) FindPlayer( id ).Kick() }
  NewTimer( "KickById", 2000, 1, player.ID );
}