22.02.2013, 11:18
Here it is:
pawn Код:
CMD:reportbug(playerid, params[])
{
if(sscanf(params, "s[128]", params))
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /reportbug [text]");
if(strlen(params) > 12)
return SendClientMessage(playerid, COLOR_GREY, "Maximum characters limit is 128.");
new File: file = fopen("bugs.cfg", io_append), string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof pName);
format(string, sizeof(string), "[%s] %s\r\n", pName, params);
fwrite(file, string);
fclose(file);
SendClientMessage(playerid, COLOR_ORANGE, "Your bug report has been saved, scripters will check it once possible.");
format(string, sizeof(string), "AdmWarn: %s has reported a bug, /bugs to view it. (Inform Zaiat about it ASAP)", pName);
SendAdminMessage(COLOR_DARKRED, 1, string);
return 1;
}
CMD:bugs(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1)
return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
new string[128], File: file = fopen("bugs.cfg", io_read), idx=1;
SendClientMessage(playerid, COLOR_ORANGE, "[City Of Roleplay Bugs]:");
while(fread(file, string))
{
format(string, sizeof(string), "%d) %s", idx, string);
SendClientMessage(playerid, COLOR_ORANGE, string);
idx ++;
}
fclose(file);
return 1;
}
CMD:deletebug(playerid, params[])
{
new line;
if(PlayerInfo[playerid][pAdmin] < 7)
return SendClientMessage(playerid, COLOR_GREY, "You are not an authorized to use this command.");
if(sscanf(params, "i", line))
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /deletebug [bugid]");
if(line < 1)
return SendClientMessage(playerid, COLOR_GREY, "Invalid bug id.");
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof pName);
fdeleteline("bugs.cfg", line);
format(string, sizeof(string), "AdmWarn: %s has deleted bug ID %d.", pName, line);
SendAdminMessage(COLOR_DARKRED, 1, string);
return 1;
}