UNBAN
#10

Alright here you go:

-Put this in the top of your script:

pawn Код:
#define COLOR_DARKRED 0xAA3333FF
Where the commands are:
pawn Код:
CMD:unban(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); // Logging in, maybe you have it as [!IsPlayerConnected]
    if(PlayerInfo[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command."); // Change it to whatever you want.
    new string[128];
    if(sscanf(params, "s[32]", params)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /unban [name]");
    new file[64], IP[16];
    format(file, sizeof(file), "users/%s.ini", params); // Change it to the directory of the accounts.
    if(dini_Exists(file))
    {
        if(dini_Int(file, "pBanned") == 0) return SendClientMessage(playerid, COLOR_GREY, "Player is not banned.");
        format(IP, sizeof(IP), "%s", dini_Get(file, "IP"));
        // Userfile
        dini_IntSet(file, "pBanned", 0);
        dini_IntSet(file, "Warns", 0);
        dini_Set(file, "Warn1", "");
        dini_Set(file, "Warn2", "");
        dini_Set(file, "Warn3", "");
        dini_Set(file, "BanReason", ""); // You've the rights to remove those if you don't have the system like that, Just comment them.
        dini_Set(file, "BannedBy", "");
        UnbanPlayer(ip[]); // The stock that was given.
        format(string, sizeof(string), "AdmWarn: %s has unbanned %s.", RPN(playerid), params);
        SendAdminMessage(COLOR_DARKRED, 1, string);
        format(string, sizeof(string), "AdmWarn: %s (%s) has unbanned %s (%s).", RPN(playerid), RPIP(playerid), params, IP);
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY, "Player name not found.");
    }

    return 1;
}
Reply


Messages In This Thread
UNBAN - by lakshikagayal - 31.05.2013, 09:02
Re: UNBAN - by mahdi499 - 31.05.2013, 09:06
Re: UNBAN - by lakshikagayal - 31.05.2013, 10:32
Re: UNBAN - by DeMoX - 31.05.2013, 11:00
Re: UNBAN - by lakshikagayal - 31.05.2013, 12:56
Re: UNBAN - by Flyfishes - 31.05.2013, 12:59
Re: UNBAN - by lakshikagayal - 31.05.2013, 14:07
Re: UNBAN - by Flyfishes - 31.05.2013, 14:43
Re: UNBAN - by Kirollos - 31.05.2013, 14:46
Re: UNBAN - by Stanford - 01.06.2013, 05:44

Forum Jump:


Users browsing this thread: 2 Guest(s)