11.02.2019, 21:25
I'm getting these errors:
Variables:
Code:
Код:
array index out of bounds (variable "Report_Reason") array index out of bounds (variable "Reporter_ID")
PHP код:
// Reports
new countReport=0;
new Reporter_ID[MAX_PLAYERS];
new Report_Reason[MAX_PLAYERS][128];
PHP код:
CMD:report(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /report [text]");
if(PlayerInfo[playerid][pRMute] > 0) return SendClientMessage(playerid, COLOR_GREY, "You are muted from reporting.");
if(AntiAdv(playerid, params)) return 1;
if(strlen(params) > 128) return SendClientMessage(playerid, COLOR_GREY, "Maximum characters limit is 128.");
if(ReportTime[playerid] > 0)
{
format(string, sizeof(string), "You need to wait %d more seconds before making a report message again.", ReportTime[playerid]);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
format(string, sizeof(string), "Report from {FF6347}[%d] {FFFF91}%s: %s", playerid, RPN(playerid), params);
SendAdminMessage(COLOR_REPORT, 1, string);
format(string, sizeof(string), "Report from [%d] %s: %s", playerid, RPN(playerid), params);
Reporter_ID[countReport]=playerid;
Report_Reason[countReport][128]=params;
countReport++;
Log("logs/reports.log", string);
SendClientMessage(playerid, COLOR_ORANGE, "Your report have been sent to the online admins, Please be patient.");
ReportTime[playerid] = 25;
SetTimerEx("ReportTimer", 1000, false, "i", playerid);
reported[playerid] = 1;
return 1;
}