View Single Post
sorallll
Senior Member
Join Date: Oct 2018
Old 11-24-2021 , 20:36   Re: Invalid index with array checked by timer
Reply With Quote #2

PHP 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];
    
    
int i ;
        while (
size)
    {
        if(
GetTime() > GetArrayCell(array_players_timei)+cv_time.IntValue)
        {
            
GetArrayString(array_players_idsisteamidsizeof(steamid));
            
GetArrayString(array_players_nameisNamesizeof(sName));
            
            
CPrintToChatAll("%t""leave_match"sName);
            
LogToFile(path"%s (%s) abandoned the match"sNamesteamid);
            

            
RemoveFromArray(array_players_timei);
            
RemoveFromArray(array_players_idsi);
            
RemoveFromArray(array_players_namei);
                        
size--;
        }else
                       
i++;
    }

sorallll is offline