How to fix this error ? Wrong section, if you can move in scripting please.
Code:
L 11/21/2021 - 17:35:50: [SM] Exception reported: Invalid index 2 (count: 2)
L 11/21/2021 - 17:35:50: [SM] Blaming: autorep_matchleft.smx
L 11/21/2021 - 17:35:50: [SM] Call stack trace:
L 11/21/2021 - 17:35:50: [SM] [0] GetArrayCell
L 11/21/2021 - 17:35:50: [SM] [1] Line 109, plugin.sp::Timer_Checker
L 11/21/2021 - 17:38:44: [SM] Exception reported: Invalid index 1 (count: 1)
L 11/21/2021 - 17:38:44: [SM] Blaming: autorep_matchleft.smx
L 11/21/2021 - 17:38:44: [SM] Call stack trace:
L 11/21/2021 - 17:38:44: [SM] [0] GetArrayCell
L 11/21/2021 - 17:38:44: [SM] [1] Line 109, plugin.sp::Timer_Checker
L 11/21/2021 - 17:39:57: [SM] Exception reported: Invalid index 1 (count: 1)
L 11/21/2021 - 17:39:57: [SM] Blaming: autorep_matchleft.smx
L 11/21/2021 - 17:39:57: [SM] Call stack trace:
L 11/21/2021 - 17:39:57: [SM] [0] GetArrayCell
L 11/21/2021 - 17:39:57: [SM] [1] Line 109, plugin.sp::Timer_Checker
Code:
public Action Timer_Checker(Handle timer)
{
if(!cv_enable.BoolValue)
return;
int size = GetArraySize(array_players_time);
if (size == 0)
return;
if (L4D_IsMissionFinalMap() == true)
return;
char steamid[64], sName[128];
for (int i = 0; i < size; i++)
{
if(GetTime() > GetArrayCell(array_players_time, i)+cv_time.IntValue)
{
GetArrayString(array_players_ids, i, steamid, sizeof(steamid));
GetArrayString(array_players_name, i, sName, sizeof(sName));
CPrintToChatAll("%t", "leave_match", sName);
LogToFile(path, "%s (%s) abandoned the match", sName, steamid);
RemoveFromArray(array_players_time, i);
RemoveFromArray(array_players_ids, i);
RemoveFromArray(array_players_name, i);
}
}
}