Thread: PartNameKick
View Single Post
Old 12/07/2019, 07:23 AM   #1
rocketbunny
Little Clucker
 
rocketbunny's Avatar
 
Join Date: Jun 2019
Location: Jakarta
Posts: 12
Reputation: 0
Default PartNameKick

I want to kick a player when using a nickname like "[PRO] boi" onplayerconnect
PHP Code:
new ForbiddenPartName[] =
{
        
"[","]","(",")","-","=","$","@","."
};

public 
OnPlayerConnect(playerid)
{
    new 
string[128];
    new 
PlayerName[MAX_PLAYER_NAME];
    
GetPlayerName(playeridPlayerNameMAX_PLAYER_NAME);
    
    if(
strfind(PlayerNameForbiddenParttrue) == -1) {
        
SendClientMessage(playerid,red"ATTENTION: Your name is not Allowed on this server, you have been Kicked!.");
        
format(string,sizeof(string),"|- Player %s (Id:%d) has been Automatically Kicked. | Reason: Forbidden Name -|",PlayerName,playerid);
        
SendClientMessageToAll(redstring);  print(string);
       return 
Kick(playerid);
    }
    return 
1;

rocketbunny is offline   Reply With Quote