Quote:
Originally Posted by Exolent[jNr]
It gets the location of addons/amxmodx/configs and stores it in a string.
It is used to avoid hard-coding the string to be that path.
|
To complete this and to explain why it shouldn't be hardcoded, it's because administrators can change that path editing core.ini :
Code:
amxx_configsdir addons/amxmodx/configs
May be you could use :
PHP Code:
is_user_in_cfgfile( const filename[], const authid[ ] )
{
new ConfigsDir[ 64 ] , buffer[ 34 ];
get_localinfo( "amxx_configsdir" , ConfigsDir , charsmax( ConfigsDir ) );
format( ConfigsDir , charsmax( ConfigsDir ) , "%s/%s" , ConfigsDir, filename);
new fh = fopen( ConfigsDir , "r" );
if( fh )
{
while( !feof( fh ) )
{
fgets( fh , buffer, charsmax( buffer ) );
trim(buffer);
remove_quotes(buffer);
if( equal( authid , buffer ) )
{
fclose( fh );
return 1;
}
}
fclose( fh );
}
return 0;
}
__________________