#define BUG_REPORT_FILE_NAME "BugLog.txt"
#define SUGGESTION_FILE_NAME "SugLog.txt"
#define BUG_REPORT_COOLDOWN_TIME 60
bool:CheckBugReportCooldown(playerid)
{
static bug_report_tick[MAX_PLAYERS];
static const cooldown_message[] =
!"Отчитываться о багах и писать предложения можно раз в "\
#BUG_REPORT_COOLDOWN_TIME" секунд.";
if (current_tick < bug_report_tick[playerid] + BUG_REPORT_COOLDOWN_TIME * 1000)
bug_report_tick[playerid] = current_tick;
return false;
}
CMD:bug(playerid, params[])
{
if (CheckBugReportCooldown(playerid))
return 1;
if (sscanf(params
, "s[129]", params
)) static const bug_str[] = " сообщил о баге: ";
new string[sizeof(bug_str)+MAX_PLAYER_NAME+128];
new File:f
= fopen(!BUG_REPORT_FILE_NAME
, io_append); if (f == File:0)
!"Ошибка: Не удалось открыть файл \"" BUG_REPORT_FILE_NAME "\" !");
for (new i = -1; string[++i] != '\0';)
string
[0] = ' ', string
[1] = '\0', strcat(string
, params
);}
CMD:sug(playerid, params[])
{
if (CheckBugReportCooldown(playerid))
return 1;
if (sscanf(params
, "s[129]", params
)) return SendClientMessage(playerid
, -1, !"Использование: /sug [предложение по улучшению]"); static const sug_str[] = " предложил: ";
new string[sizeof(sug_str)+MAX_PLAYER_NAME+128];
new File:f
= fopen(!SUGGESTION_FILE_NAME
, io_append); if (f == File:0)
!"Ошибка: Не удалось открыть файл \"" SUGGESTION_FILE_NAME "\" !");
for (new i = -1; string[++i] != '\0';)
SendClientMessage(playerid
, -1, !"Вы успешно написали предложение по улучшению. Спасибо!"); string
[0] = ' ', string
[1] = '\0', strcat(string
, params
);}