Raised This Month: $ Target: $400
 0% 

immunity to change tag admin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-11-2009 , 10:20   Re: immunity to change tag admin
Reply With Quote #1

So you want the players with those exact names to be immune?
__________________
Bugsy is offline
algoasi
Member
Join Date: Nov 2008
Location: Pluton
Old 04-11-2009 , 11:47   Re: immunity to change tag admin
Reply With Quote #2

exactly bro, please help me with this. be 100% grateful for your help
algoasi is offline
Send a message via MSN to algoasi
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 #3

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
algoasi
Member
Join Date: Nov 2008
Location: Pluton
Old 04-11-2009 , 14:19   Re: immunity to change tag admin
Reply With Quote #4

bugsy, would you be so kind to make me the sma? im having some trouble with the compilation...


sorry man .. I have little knowledge in this

algoasi is offline
Send a message via MSN to algoasi
Reply



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