Ban an IP
#2

BanEx(playerid, reason);
Ban(playerid);

These are stored into samp.ban, BanEx has a reason and regular Ban has no reason

They both ban IPs

EDIT: Re-read the original post...To ban the name you could do something like....


I'll use dini as an example
pawn Код:
OnPlayerConnect(playerid)
{
    new file[50];
    format(file, sizeof(file), "Accounts/%s", Name(playerid));
    if(dini_Exists(file))
    {
        if(dini_Int(file, "Banned") == 1)
        {
            new reason[75];
            format(reason,sizeof(reason), "%s[%d] has been kicked -Name Banned.", Name(playerid), playerid);
            SendClientMessageToAll(0xCC0000AA, reason);
            Kick(playerid);
        }
    }
}
In the ban command;
pawn Код:
new file[50];
format(file, sizeof(file), "Accounts/%s", Name(playerid));
if(dini_Exists(file)) dini_SetInt(file, "Banned", 1);

You'd need this to copy/paste that in...Which I don't recommend, should modify it to your needs
pawn Код:
stock Name(playerid)
{
    new nname[MAX_PLAYER_NAME]; //Creates the variable we will store the players name in
    GetPlayerName(playerid, nname, sizeof(nname)); //Gets the name storing it into our nname variable & the length will be max_player_name
    return nname; //Returns the name of the player
}
Reply


Messages In This Thread
Ban an IP - by Thunderbolt - 03.01.2012, 09:54
Re: Ban an IP - by [ABK]Antonio - 03.01.2012, 09:55
Re: Ban an IP - by Thunderbolt - 03.01.2012, 09:56

Forum Jump:


Users browsing this thread: 1 Guest(s)