offline ban
#4

Ok not sure if these is gonna work, mostly because im not using Y_INI but try these:

pawn Код:
CMD:oban(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] ==10 || IsPlayerAdmin(playerid))
    {
        new targetname[24], filestring[79], adminname[MAX_PLAYER_NAME];
        if(sscanf(params, "s[24]", targetname)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /oban [Player's Name]");
        format(filestring, sizeof(filestring), "/Asystem/Users/%s.ini", targetname);
        if(!fexist(filestring)) return SendClientMessage(playerid, COLOR_RED, "[Error]: The player name you have chosen was not found in our system.");
        else
        {
            GetPlayerName(playerid, adminname, sizeof(adminname));
            new INI:File = INI_Open(filestring);
            INI_SetTag(File, "data");
            INI_WriteInt(File, "Ban", 1);
            //-----------------------------
            remotePlayerAdmin = 0;
            INI_Int("Admin", remotePlayerAdmin );
            if(remotePlayerAdmin > 0)
            {
                INI_Close(File);
                SendClientMessage(playerid,COLOR_RED,"That player is admin!");
                return 1;
            }
            //-----------------------------
            INI_Close(File);
            new done[128];
            format(done, sizeof(done), "[BAN] Admin %s (id:%d) Offlinebanned %s from server.", adminname, playerid, targetname);
            SendClientMessageToAll(COLOR_RED, done);
            return 1;
        }
    }
    else return SendClientMessage(playerid,COLOR_RED,"You do not have permission to use this command!");
}
Reply


Messages In This Thread
offline ban - by GeneralAref - 20.12.2015, 07:56
Re: offline ban - by Stanislaus - 20.12.2015, 08:43
Re: offline ban - by GeneralAref - 20.12.2015, 08:47
Re: offline ban - by DRIFT_HUNTER - 20.12.2015, 08:52

Forum Jump:


Users browsing this thread: 1 Guest(s)