Thread: [Solved] Loop order
View Single Post
Clauu
Senior Member
Join Date: Feb 2008
Location: RO
Old 01-17-2018 , 03:21   Re: Loop order
Reply With Quote #19

No, the problem is that we forget to remove ; from the player name, if has it. Sorry for that
PHP Code:
ReadFile( )
{
    
ArrayClearg_aDatabase );

    new 
g_iItemsPlayerData ];

    new 
szConfigs32 ], szFormat64 ], szPlayerData512 ];
    
get_configsdirszConfigscharsmaxszConfigs ) );
    
    
formatexszFormatcharsmaxszFormat ), "%s/%s"szConfigsg_szFile );
    
    new 
iFile fopenszFormat"rt" );
    
    if( 
iFile )
    {
        while( ! 
feofiFile ) )
        {    
            
fgetsiFileszPlayerDatacharsmaxszPlayerData ) );
            
trimszPlayerData );
            
            if( 
strlen(szPlayerData) < 10 || ( szPlayerData] == '/' && szPlayerData] == '/' ) )
            continue;
            
            if(
parseszPlayerDatag_iItems[Player_Name], charsmaxg_iItems[Player_Name] ), g_iItems[Player_Password], charsmaxg_iItems[Player_Password]), g_iItems[Player_AccessFlags], charsmaxg_iItems[Player_AccessFlags] ), g_iItems[Player_Prefix], charsmaxg_iItems[Player_Prefix] ) ) < 4)
             continue;
            
             if(
szPlayerData] == ';') {
                   
g_iItems[Player_Suspended]=1;
                   
replace(g_iItems[Player_Name],charsmax(g_iItems[Player_Name]),";","");
             }
            
ArrayPushArrayg_aDatabaseg_iItems );
        }
        
fcloseiFile );
    }

Now it will be fine.

Last edited by Clauu; 01-17-2018 at 03:23.
Clauu is offline