That :
Code:
( auth[ ] ) // What is auth[ ] ? Why they are this param ?
{
new ConfigsDir[ 64 ] , line[ 46 ]; // Why an array with 64 and one with 46 ? Why the name of the variable is ConfigsDir ?
new bool: found; // I understand very fast ... but ...
get_localinfo( "amxx_configsdir" , ConfigsDir , charsmax( ConfigsDir ) );
/*
I reade it : <a href="http://www.amxmodx.org/funcwiki.php?search=get_localinfo&go=search" target="_blank" rel="nofollow noopener">http://www.amxmodx.org/funcwiki.php?...info&go=search</a>
but i do not understand the objective of that. If someone can help me ^^
*/
format( ConfigsDir , charsmax( ConfigsDir ) , "%s/vip.ini" , ConfigsDir );
// It is the location of my .ini filesi think its only that ?
new fh; // why the name is fh ?
fh = fopen( ConfigsDir , "r" );
/*
I reade it : <a href="http://www.amxmodx.org/funcwiki.php?go=func&id=92" target="_blank" rel="nofollow noopener">http://www.amxmodx.org/funcwiki.php?go=func&id=92</a>
But why it is a r and not a w ?
*/
if( fh ) // If fh = ? what ? I do not understand this variable
{
while( !feof( fh ) ) // hum i think it is okay...
{
fgets( fh , line, charsmax( line ) ); // here nothings
if( equal( auth , line , strlen( auth ) ) )
{
found = true;
break; // why they are a break; ?
}
else
{
found = false;
// Why they are no break; ?
}
}
}
fclose( fh ); // It's okay
return found; // Why not return 0; ?
}
I think it can help a lots of people other than me.
Thank you in advance all !
The function with no comment :
Code:
is_user_in_file( auth[ ] )
{
new ConfigsDir[ 64 ] , line[ 46 ];
new bool: found;
get_localinfo( "amxx_configsdir" , ConfigsDir , charsmax( ConfigsDir ) );
format( ConfigsDir , charsmax( ConfigsDir ) , "%s/vip.ini" , ConfigsDir );
new fh;
fh = fopen( ConfigsDir , "r" );
if( fh )
{
while( !feof( fh ) )
{
fgets( fh , line, charsmax( line ) );
if( equal( auth , line , strlen( auth ) ) )
{
found = true;
break;
}
else
{
found = false;
}
}
}
fclose( fh );
return found;
}
__________________