|
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
|
01-17-2018
, 09:04
Re: Loop order
|
#20
|
Quote:
Originally Posted by Clauu
No, the problem is that we forget to remove ; from the player name, if has it. Sorry for that
PHP Code:
ReadFile( )
{
ArrayClear( g_aDatabase );
new g_iItems[ PlayerData ];
new szConfigs[ 32 ], szFormat[ 64 ], szPlayerData[ 512 ];
get_configsdir( szConfigs, charsmax( szConfigs ) );
formatex( szFormat, charsmax( szFormat ), "%s/%s", szConfigs, g_szFile );
new iFile = fopen( szFormat, "rt" );
if( iFile )
{
while( ! feof( iFile ) )
{
fgets( iFile, szPlayerData, charsmax( szPlayerData ) );
trim( szPlayerData );
if( strlen(szPlayerData) < 10 || ( szPlayerData[ 0 ] == '/' && szPlayerData[ 1 ] == '/' ) )
continue;
if(parse( szPlayerData, g_iItems[Player_Name], charsmax( g_iItems[Player_Name] ), g_iItems[Player_Password], charsmax( g_iItems[Player_Password]), g_iItems[Player_AccessFlags], charsmax( g_iItems[Player_AccessFlags] ), g_iItems[Player_Prefix], charsmax( g_iItems[Player_Prefix] ) ) < 4)
continue;
if(szPlayerData[ 0 ] == ';') {
g_iItems[Player_Suspended]=1;
replace(g_iItems[Player_Name],charsmax(g_iItems[Player_Name]),";","");
}
ArrayPushArray( g_aDatabase, g_iItems );
}
fclose( iFile );
}
}
Now it will be fine.
|
Thanks a lot, it's working!
__________________
|
|
|
|