13.06.2012, 16:08
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) :
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®
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;
}
i hope you help me .
Regards Saw®