SA-MP Forums Archive
[HELP] Ban/jail (& other stuff) for disconnected accounts - 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)
+--- Thread: [HELP] Ban/jail (& other stuff) for disconnected accounts (/showthread.php?tid=350714)



[HELP] Ban/jail (& other stuff) for disconnected accounts - Saw® - 13.06.2012

Hi , i done the ban command yesterday , so , i thought that i can do the same for disconnected account ,
so like : /Ban Name Reason
& i can do it for /jail...

so this is my ban command using dini (i'm not using sscanf) :
pawn Код:
dcmd_ban(playerid, params[])
{
    if (AdminLevel[playerid] < 3 ) {
        SendClientMessage(playerid, COLOR_CERVENA, "   Only Admin or than can do that");
    }
    else {
        if (AdminLevel[playerid] >= 3) {
            if(strlen(params) > 50) return SendClientMessage(playerid, COLOR_CERVENA, " [!] Bad parameters !");
            new pos;
            new string[150];
            if(!params[0] || !(pos = chrfind(' ', params) + 1) || !params[pos]) return SendClientMessage(playerid, COLOR_CERVENA, " [!] Usage: /ban [ID] [Reason]");

            new CMD_ID = strval(params);
            if(!IsPlayerConnected(CMD_ID)) return SendClientMessage(playerid, COLOR_CERVENA, " [!] Player with this ID is not on the server !");
            if(IsPlayerNPC(CMD_ID)) return SendClientMessage(playerid, COLOR_CERVENA, " [!] This is NPC !");
            format(string, sizeof(string), "[!] You have been banned by Administrator %s. [Reason: %s]",PlayerName(playerid),params[pos]);
            SendClientMessage(CMD_ID, COLOR_CERVENA, string);

            format(string, sizeof(string), " [!]{FF0000} %s {FFFFFF}was banned by {00FF00}Administrator {00CCFF} %s {FFFFFF}[Reason: {DDD100} %s{FFFFFF}]", PlayerName(CMD_ID),PlayerName(playerid),params[pos]);
            SendClientMessageToAll(COLOR_CERVENA, string);
            format(string, sizeof(string), "ADMINISTRATOR: %s Ban[%s]", PlayerName(playerid), params[pos]);
            Banned[CMD_ID] = 1;
            TimeBanned[CMD_ID] ++;
            dini_Set(file[CMD_ID], "BanReason", params[pos]);
            dini_Set(file[CMD_ID], "BanAdmin", PlayerName(playerid));
            Kick(CMD_ID);
        }
    }
    return 1;
}
So the command before can ban connected players only , i want that the dini open the X file & change IGBAN to 1
i hope you help me .

Regards Saw®


Re: [HELP] Ban/jail (& other stuff) for disconnected accounts - Saw® - 13.06.2012

Anyone ? i want only how order to dini to ban disconnected accounts (opening their files.ini)


Re: [HELP] Ban/jail (& other stuff) for disconnected accounts - Jhero - 13.06.2012

This may help,

https://sampwiki.blast.hk/wiki/File_Functions