SA-MP Forums Archive
/unban command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /unban command (/showthread.php?tid=269005)



/unban command - cloudysky - 14.07.2011

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.


Re: /unban command - willsuckformoney - 14.07.2011

Easier to change Kick(pid) with Ban(pid) so you can unban the IP


Re: /unban command - cloudysky - 14.07.2011

but even then, how would I unban the IP?


Re: /unban command - cloudysky - 14.07.2011

Anyone?


Re: /unban command - Kush - 14.07.2011

You would open the samp.ban file and remove the player's ip....


Re: /unban command - cloudysky - 14.07.2011

No but i mean in game...