Raised This Month: $ Target: $400
 0% 

[ Solved ] is_user_in_file


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 06-22-2012 , 15:24   [ Solved ] is_user_in_file
Reply With Quote #1

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; }
__________________
Pawn ? Useless
Aooka is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode