Raised This Month: $ Target: $400
 0% 

immunity to change tag admin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-11-2009 , 12:16   Re: immunity to change tag admin
Reply With Quote #10

In your amxmodx\configs dir place a file named "immune_names.txt" in the below format.

Code:
name1
name2
name3
name4
See below for extra options
PHP Code:
public CheckNameid )
{
    if ( !
is_user_connected(id) )
        return 
PLUGIN_HANDLED;
        
    new 
szNamesFile[64];
    new 
szItem[33];
    new 
szName[33];

    
get_configsdir(szNamesFile63);
    
formatszNamesFile 63 "%s/immune_names.txt" szNamesFile );

    if ( !
file_existsszNamesFile ) )
        return 
0;

    new 
iFile fopen szNamesFile "r" );

    
get_user_nameid szName 32 );
    
    while ( !
feofiFile ) )
    {
        
fgetsiFile ,  szItem 32 );
        
        if ( 
equalszNameszItem strlen(szName) ) )
        {
            
fcloseiFile );
            return 
1;
        }
    }
    
    
fcloseiFile );
    
    return 
0;

This function is case sensitive, if you do not want it to not be, change 'equal' to 'equali'
OR
If you want to return true if the file item is found within the players name replace the equal statement with:
PHP Code:
if ( containszNameszItem ) > -)
//OR case insensitive
if ( containiszNameszItem ) > -
Example usage:
PHP Code:
public client_putinserver(id)
{
    if ( 
CheckName(id) )
        
//player is immune since name found
    
else
        
//players name not found
//OR
    
if ( !CheckName(id) )
        
//players name not found
    
else
        
//player is immune

__________________

Last edited by Bugsy; 04-11-2009 at 12:32.
Bugsy 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 02:21.


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