15.08.2012, 21:25
Is there a way to ban JUST THE NAME and not the IP? For example if I ban someone like Tony_Johnson I ban just his name but if he changes name he can join.-
public OnPlayerConnect(playerid)
{
new pName[25];
GetPlayerName(playerid,pName,25);
if(!(strcmp(pName,"BANNEDNAME"))) return SendClientMessage(playerid,-4,"You're banned."),Kick(playerid);
return 1;
}
public OnPlayerConnect(playerid) { new forbidden_names[][] = {"Tony_Johnson","Gooday","and_so_on"}, username[MAX_PLAYER_NAME]; GetPlayerName(playerid,username,MAX_PLAYER_NAME); for(new i; i<sizeof(forbidden_names); i++) { if(!strcmp(username,forbidden_names[i])) { Kick(playerid); return 1; } } return 1; }