/unban command
#1

Hey, I basically need an unban command for this ban command...

pawn Код:
command(ban, playerid, params[])
{
    if( PlayerInfo[playerid][Admin] >= 2)
    {
        new admin[25];
        new pid;
        new player[25];
        new reason[128];
        new string[128];

        if(sscanf(params, "us[128]", pid, reason)) return SendClientMessage(playerid, COLOUR_WHITE, "Hint: /ban [Playerid/Name] [Reason]");
        if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOUR_WHITE, "That player ID is not connected.");
        GetPlayerName(playerid, admin, 25);
        GetPlayerName(pid, player, 25);
        format(string, sizeof(string),"**Server Admin %s has {F81414}banned {00BFFF}%s. Reason: %s.**",admin, player, reason);
        SendClientMessageToAll(COLOUR_ALERT,string);
        SendClientMessage(pid, COLOUR_WHITE, "You have been {F81414}banned!" );
        PlayerInfo[pid][Banned] = 1;
        SaveUser(pid);
        Kick(pid);
    }
    return 1;
}

I know it's got to read the account folder but I don't know how to do it. Thanks.
Reply


Messages In This Thread
/unban command - by cloudysky - 14.07.2011, 15:32
Re: /unban command - by willsuckformoney - 14.07.2011, 15:34
Re: /unban command - by cloudysky - 14.07.2011, 15:35
Re: /unban command - by cloudysky - 14.07.2011, 17:09
Re: /unban command - by Kush - 14.07.2011, 17:11
Re: /unban command - by cloudysky - 14.07.2011, 17:13

Forum Jump:


Users browsing this thread: 3 Guest(s)