Nister_Just
Умник
Багается как-то репорт и показывает вместо ника 0,0,0,0,0,0 и везде на всех текстах так после репорта ник показывает!
Код:
const
MAX_ADMIN_REPORTS = 61,
MAX_ADMIN_REPORT_TEXT_LENGTH = 128;
enum e_ADMIN_REPORT_INFO
{
rID,
rPlayerID,
rText[MAX_ADMIN_REPORT_TEXT_LENGTH],
rWhenWroted_Text[10],
rWhenWroted_Time,
bool:rIsTooked
};
new aReportInfo[MAX_ADMIN_REPORTS][e_ADMIN_REPORT_INFO];
CMD:report(playerid)
{
if(PlayerInfo[playerid][pMuteTime] > 0) return true;
if(GetPVarInt(playerid, "report_id")) return SendClientMessage(playerid, -1, !"Ожидайте ответа от администрации!");
ShowPlayerDialog(playerid, 13212, DIALOG_STYLE_INPUT,
!"{FFFF00}Связь с администрацией",
!"{FFFFFF}Вы собираетесь написать сообщения администрации.\n\
{FFFFFF}Перед тем как отправить сообщения убедитесь, что не один\n\
{FFFFFF}из пунктов помощи не дал вам ответа на ваш вопрос\n\n\
{FF3B3B}Запрещено:\n\
{FFFFFF}1. Просьбы на отвлеченные от сервера темы\n\
{FFFFFF}2. Попрошайничество(все игровые единицы вы должны получать РП путём)\n\
{FFFFFF}3. Жалобы не имеющие доказательств\n\n\
Введите вашу жалобу:\n",
!"Далее", !"Назад");
return true;
}
case 13212:
{
if(!response) return true;
if(strlen(inputtext) < 2 || strlen(inputtext) > 60) return cmd_report(playerid);
new str[240],hour,minute,second;
format(str, sizeof(str), "[Жалоба] от %s[%d]:"WH_C" %s",PlayerInfo[playerid][pNames], playerid, inputtext);
ABroadCast(0xFF6347FF, str,1);
format(str, sizeof(str), "{FF6347}[Информация]{FFFFFF} Вы отправили жалобу: %s", inputtext);
SendClientMessage(playerid, -1, str);
SendClientMessage(playerid, -1, !"На ваш вопрос обязательно ответит администрация!");
for(new i = 1; i < MAX_ADMIN_REPORTS; i++)
{
if(aReportInfo[i][rPlayerID] != -1) continue;
aReportInfo[i][rIsTooked] = false;
aReportInfo[i][rID] = i;
aReportInfo[i][rPlayerID] = playerid;
format(str, sizeof(str), "%s", params);
strmid(aReportInfo[i][rText], inputtext, 0, MAX_ADMIN_REPORT_TEXT_LENGTH, MAX_ADMIN_REPORT_TEXT_LENGTH);
aReportInfo[i][rWhenWroted_Time] = gettime();
gettime(hour, minute, second);
format(str, sizeof(str), "%02d:%02d:%02d", hour, minute, second);
strmid(aReportInfo[i][rWhenWroted_Text], str, 0, 10, 10);
SetPVarInt(playerid, "report_id", i);
break;
}
return true;
}
case 801:
{
if(!response)
{
aReportInfo[GetPVarInt(playerid, "report_id_to_answer")][rIsTooked] = false;
DeletePVar(playerid, "report_id_to_answer");
ShowPlayer_Admin_Report_List(playerid);
}
else
{
new report_id = GetPVarInt(playerid, "report_id_to_answer"),target_id = aReportInfo[report_id][rPlayerID];
if(target_id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, !"Ошибка: Данный игрок отключился от сервера!");
static const fmt_str[] = "Администратор %s[%d] ответил игроку %s[%d]:"WH_C" %s";
new str[sizeof(fmt_str) + (-2 + MAX_PLAYER_NAME) + (-2 + 4) + (-2 + MAX_PLAYER_NAME) + (-2 + 4) + (-2 + 128)];
format(str, sizeof(str), fmt_str, PlayerInfo[playerid][pNames], playerid, PlayerInfo[target_id][pNames], target_id, inputtext);
ABroadCast(0xFAAC58FF ,str,1);
format(str, sizeof(str), "Вам ответил администратор %s[%d]:"WH_C" %s. Приятной игры!", PlayerInfo[playerid][pNames],playerid, inputtext);
SendClientMessage(target_id, 0xFAAC58FF, str);
PlayerPlaySound(target_id, 5205, 0.0, 0.0, 0.0);
DeletePVar(target_id, "report_id");
aReportInfo[report_id][rIsTooked] = false;
aReportInfo[report_id][rID] = report_id;
aReportInfo[report_id][rPlayerID] = -1;
aReportInfo[report_id][rText][0] = EOS;
aReportInfo[report_id][rWhenWroted_Time] = -1;
aReportInfo[report_id][rWhenWroted_Text][0] = EOS;
}
return true;
}
publics: admin_reports_cleaner()
{
static const admin_clean_message[] = "[REPORT-CLEANER] Было удалено: %d жалоб/сообщений.";
new str[sizeof(admin_clean_message) + (-2 + 2)],total_cleaned_reports = 0;
for(new i = 1; i < MAX_ADMIN_REPORTS; i++)
{
if(aReportInfo[i][rPlayerID] == -1) continue;
if(gettime() - aReportInfo[i][rWhenWroted_Time] >= 10)
{
SendClientMessage(aReportInfo[i][rPlayerID], -1, !"Ваша жалоба/сообщение для администрации было удалено системой.");
DeletePVar(aReportInfo[i][rPlayerID], "report_id");
aReportInfo[i][rIsTooked] = false;
aReportInfo[i][rID] = i;
aReportInfo[i][rPlayerID] = -1;
aReportInfo[i][rText][0] = EOS;
aReportInfo[i][rWhenWroted_Time] = -1;
aReportInfo[i][rWhenWroted_Text][0] = EOS;
total_cleaned_reports++;
}
}
format(str, sizeof(str), admin_clean_message, total_cleaned_reports);
ABroadCast(-1 ,str,1);
return true;
}
stock ShowPlayer_Admin_Report_List(playerid)
{
new str[1048],total_admin_reports = 0;
for(new i = 1; i < MAX_ADMIN_REPORTS; i++)
{
if(aReportInfo[i][rPlayerID] == -1) continue;
format(str, sizeof(str), "%s %d. %s\n", str, i, PlayerInfo[aReportInfo[i][rPlayerID]][pNames]);
total_admin_reports++;
}
if(total_admin_reports == 0) return SendClientMessage(playerid, -1, !"Важно: На данный момент нет доступных жалоб/сообщений от игроков.");
ShowPlayerDialog(playerid, 800, DIALOG_STYLE_LIST, !"Список жалоб/сообщений от игроков", str, !"Выбрать", !"Отмена");
return 1;
}
stock ShowPlayer_Admin_Report_Answer(playerid, report_id)
{
SetPVarInt(playerid, "report_id_to_answer", report_id);
aReportInfo[report_id][rIsTooked] = true;
static const fmt_str[] = "\
Жалоба/сообщение: %s\n\n\
Отправил: %s\n\
Время отправки: %s\n\n\
Введите ваш ответ в диалоговое поле ниже:";
new str[sizeof(fmt_str) + (-2 + MAX_ADMIN_REPORT_TEXT_LENGTH) + (-2 + MAX_PLAYER_NAME) + (-2 + 16)],strg[128];
format(strg, sizeof(strg), "%d. %s", report_id, PlayerInfo[aReportInfo[report_id][rPlayerID]][pNames]);
format(str, sizeof(str),fmt_str,aReportInfo[report_id][rText], PlayerInfo[aReportInfo[report_id][rPlayerID]][pNames], aReportInfo[report_id][rWhenWroted_Text]);
ShowPlayerDialog(playerid, 801, DIALOG_STYLE_INPUT, strg, str, !"Ответить", !"Назад");
return true;
}
Вложения
-
12.5 KB Просмотры: 26
