Hello, Need abit of a help with..
#1

Hello,
I need litle help with unbanning player, actualy, I wanna set every single user account's Permbanned to 0, and I'm struggling with the command.. Here is what i made little..

pawn Код:
CMD:unbanallplayers(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 8)
    {
        SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
        return 1;
    }

    foreach(Player,i)
    OnPlayerOfflineLogin(i);
    if( PlayerInfo[i][pPermaBanned] >= 1)
    {
        PlayerInfo[i][pPermaBanned] = 0;
        PlayerInfo[i][pBanned] = 0;
        PlayerInfo[i][pWarns] = 0;
        PlayerInfo[i][pDisabled] = 0;
        RemoveBan(PlayerInfo[i][pIP]);
        print("DEBUG: Saving variables to file");
        OnPlayerOfflineSave(i);
        print("DEBUG: Variables saved properly");
    }
    else { //Still sets it to 0 even if not banned.
    PlayerInfo[i][pPermaBanned] = 0;
    PlayerInfo[i][pBanned] = 0;
    print("DEBUG: (ELSE MODE) Players has successfully been unbanned");
    OnPlayerOfflineSave(i);
    print("DEBUG: (ELSE MODE) All player accounts has been saved.");
    }
    return 1;
}
foreach is for al players right, I'm abit confused .. if i can use it for ofline loop aswell..
Is my setup correct?

Please do explain and help me out .. Thank you.
Reply


Messages In This Thread
Hello, Need abit of a help with.. - by Gill - 23.12.2013, 08:38
Re: Hello, Need abit of a help with.. - by park4bmx - 23.12.2013, 09:01
Re: Hello, Need abit of a help with.. - by Gill - 23.12.2013, 09:46
Re: Hello, Need abit of a help with.. - by dominik523 - 23.12.2013, 10:10
Re: Hello, Need abit of a help with.. - by Gill - 23.12.2013, 10:19
Re: Hello, Need abit of a help with.. - by Threshold - 23.12.2013, 15:13

Forum Jump:


Users browsing this thread: 3 Guest(s)