Thread: [Solved] Loop order
View Single Post
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-17-2018 , 09:04   Re: Loop order
Reply With Quote #20

Quote:
Originally Posted by Clauu View Post
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.
Thanks a lot, it's working!
__________________
edon1337 is offline