Raised This Month: $ Target: $400
 0% 

[ Solved ] is_user_in_file


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-22-2012 , 18:43   Re: [REQ] is_user_in_file
Reply With Quote #4

Quote:
Originally Posted by Exolent[jNr] View Post
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 
ConfigsDir64 ] , buffer34 ];
    
    
get_localinfo"amxx_configsdir" ConfigsDir charsmaxConfigsDir ) );
    
    
formatConfigsDir charsmaxConfigsDir ) , "%s/%s" ConfigsDir,  filename);
    
    new 
fh fopenConfigsDir "r" );
    if( 
fh )
    {
        while( !
feoffh ) )
        {
            
fgetsfh buffercharsmaxbuffer ) );
            
trim(buffer);
            
remove_quotes(buffer);
            
            if( 
equalauthid buffer ) )
            {
                
fclosefh );
                return 
1;
            }
        }
        
fclosefh );
    }

    return 
0;

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 06-22-2012 at 20:01.
ConnorMcLeod 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