Raised This Month: $ Target: $400
 0% 

immunity to change tag admin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
algoasi
Member
Join Date: Nov 2008
Location: Pluton
Old 04-08-2009 , 11:05   immunity to change tag admin
Reply With Quote #1

I have this script. but I do not want to change the name of the admin?

can you help?



PHP Code:
#include <amxmodx> 
PHP Code:
[left]#include <amxmisc>#define PLUGIN "TAGNAME"
#define VERSION "1.0"
#define AUTHOR "algoasi"
public plugin_init()
   
register_plugin(PLUGINVERSIONAUTHOR)public client_putinserver(id)
   
set_task(3.0,"change",id);
   
public 
change(id)
{
   if(!
is_user_connected(id))
      return 
0;
     
   new 
name[32], buffer[32];
   
get_user_name(id,name,31);
   
   if(
containi(name,"[tag]") != -1)
      return 
0;
     
   
formatex(buffer,sizeof buffer 1"[tag] *%s"name);
   
client_cmd(id"name ^"%s^""buffer);
   
   return 
1;
}public 
client_infochangedid )
{
   new 
newname32 ], oldname32 ], buffer[32];
   
get_user_info(id"name"newname31 );
   
get_user_name(idoldname31 );
   
   if(
equalinewnameoldname ) )
      return 
PLUGIN_CONTINUE;
     
   if(
containi(newname,"[tag]") != -1)
      return 
PLUGIN_CONTINUE;
     
   
formatex(buffer,sizeof buffer 1"[tag] *%s"newname);
   
client_cmd(id"name ^"%s^""buffer);
   
   return 
PLUGIN_CONTINUE;
}[/
left

Last edited by algoasi; 04-08-2009 at 11:08.
algoasi is offline
Send a message via MSN to algoasi
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-08-2009 , 11:21   Re: immunity to change tag admin
Reply With Quote #2

PHP Code:
if(!is_user_connected(id))
{
    return
}
if(
is_user_admin(id))
{
    return

You must make sure all users are connected because nobody will have admin before that returns true.
__________________

Last edited by fysiks; 04-08-2009 at 11:23.
fysiks is offline
algoasi
Member
Join Date: Nov 2008
Location: Pluton
Old 04-08-2009 , 11:39   Re: immunity to change tag admin
Reply With Quote #3

mnmn! not work for me


I do not understand
algoasi is offline
Send a message via MSN to algoasi
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 04-08-2009 , 13:36   Re: immunity to change tag admin
Reply With Quote #4

Code:
   if(!is_user_connected(id) || (get_user_flags(id) & ADMIN_IMMUNITY))       return 0;
__________________
hleV is offline
algoasi
Member
Join Date: Nov 2008
Location: Pluton
Old 04-08-2009 , 22:35   Re: immunity to change tag admin
Reply With Quote #5

work! ...
but I want you all to admin flags. not only "a"
algoasi is offline
Send a message via MSN to algoasi
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-08-2009 , 23:03   Re: immunity to change tag admin
Reply With Quote #6

PHP Code:
if( !is_user_connected(id) || is_user_admin(id) )
      return 
PLUGIN_CONTINUE
__________________
Bugsy is offline
algoasi
Member
Join Date: Nov 2008
Location: Pluton
Old 04-11-2009 , 09:51   Re: immunity to change tag admin
Reply With Quote #7

excellent!

but I have a new idea. hope you can help me

a file (txt, ini, cfg) for the names immune the tag

example:

look at this



Quote:
//These people do not have the tag

Pamela.
Shakira
Obama
Bush.
Maria
Bill gate$
Blaise Pascal



You can help me with this

Last edited by algoasi; 04-11-2009 at 09:57.
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 , 10:20   Re: immunity to change tag admin
Reply With Quote #8

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 #9

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 #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
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