How to ban? +REP
#1

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.-
Reply
#2

check the name on OnPlayerConnect and kick him if the name is banned?
Reply
#3

pawn Код:
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;
}
Reply
#4

Код:
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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)