Array does not work properly " array index out of bounds "
#1

I'm getting these errors:

Код:
array index out of bounds (variable "Report_Reason")
array index out of bounds (variable "Reporter_ID")
Variables:

PHP код:
// Reports
new countReport=0;
new 
Reporter_ID[MAX_PLAYERS];
new 
Report_Reason[MAX_PLAYERS][128]; 
Code:

PHP код:
CMD:report(playeridparams[])
{
    new 
string[128];
    if(!
IsPlayerLoggedIn(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(
sscanf(params"s[128]"params)) return SendClientMessage(playeridCOLOR_WHITE"[Usage]: /report [text]");
    if(
PlayerInfo[playerid][pRMute] > 0) return SendClientMessage(playeridCOLOR_GREY"You are muted from reporting.");
    if(
AntiAdv(playeridparams)) return 1;
    if(
strlen(params) > 128) return SendClientMessage(playeridCOLOR_GREY"Maximum characters limit is 128.");
    if(
ReportTime[playerid] > 0)
    {
        
format(stringsizeof(string), "You need to wait %d more seconds before making a report message again."ReportTime[playerid]);
        
SendClientMessage(playeridCOLOR_GREYstring);
        return 
1;
    }
     
format(stringsizeof(string), "Report from {FF6347}[%d] {FFFF91}%s: %s"playeridRPN(playerid), params);
    
SendAdminMessage(COLOR_REPORT1string);
    
format(stringsizeof(string), "Report from [%d] %s: %s"playeridRPN(playerid), params);
    
    
Reporter_ID[countReport]=playerid;
    
Report_Reason[countReport][128]=params;
    
countReport++;
    
Log("logs/reports.log"string);
    
SendClientMessage(playeridCOLOR_ORANGE"Your report have been sent to the online admins, Please be patient.");
    
ReportTime[playerid] = 25;
    
SetTimerEx("ReportTimer"1000false"i"playerid);
    
reported[playerid] = 1;
    return 
1;

Reply


Messages In This Thread
Array does not work properly " array index out of bounds " - by XpoZzA - 11.02.2019, 21:25
Re: Array does not work properly " array index out of bounds " - by Pottus - 11.02.2019, 22:23

Forum Jump:


Users browsing this thread: 1 Guest(s)