#1

How to make if player name Contains "BROOK"
kick him ?
Reply
#2

PHP код:
//OnPlayerConnect
    
new 
        
l_t_name[MAX_PLAYER_NAME]
    ;
    
GetPlayerName(playeridl_t_nameMAX_PLAYER_NAME);
    if( 
strfind(l_t_name"BROOK"true) != -) return Kick(playerid); 
if you want multiple names you should use a function like this

PHP код:
IsValidName(playerid)
{
    new 
        
l_t_name[MAX_PLAYER_NAME]
    ;
    
GetPlayerName(playeridl_t_nameMAX_PLAYER_NAME);
    if( 
strfind(l_t_name"BROOK"true) != -) return false;
    else if( 
strfind(l_t_name"HOREEH"true) != -) return false;
    else if( 
strfind(l_t_name"FOO"true) != -) return false;
    else if( 
strfind(l_t_name"BAR"true) != -) return false;
    return 
true;
}
// onplayerconnect
if(!IsValidName(playerid)) return Kick(playerid); 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)