Raised This Month: $ Target: $400
 0% 

(admin immunity)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
revox
Member
Join Date: Feb 2010
Location: romania, bucharest
Old 03-17-2010 , 19:06   (admin immunity)
Reply With Quote #1

i have a problem to insert immunity in this plugin....
if an admin with flag "a" (immunity) say fuck or any kind of swear the automatic ga give him ga... i want to insert immunity in this plugin.. but i dont know how..
please help..

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define ACCESS             ADMIN_KICK
#define WORDS            64
#define SWEAR_GAGMINUTES    3
#define SHOW

new const tag[] = "[Gag]";
new const 
g_FileName[] = "gag_words.ini";

new 
bool:g_Gaged33 ], g_GagTime33 ],
bool:g_SwearGag33 ], bool:g_CmdGag33 ],
bool:g_NameChanged[33];

new 
g_reason32 ], g_admin32 ], g_name33 ][ 32 ];

new 
g_WordsFile128 ];
new 
g_WordsWORDS ][ 32 ], g_Countg_Len;

new 
pointg_msgsaytext;
new 
toggle_tag

public plugin_init() 
{
    
register_plugin("Advance Gag""2.1""anakin_cstrike/ update -B1ng0-")
    
    
register_concmd"amx_gag""gag_cmd"ACCESS,"- <nume> <minute> <motiv> - Da gag jucatorului" );
    
register_concmd"amx_ungag""ungag_cmd"ACCESS"- <nume> - Scoate gagul" );
    
register_clcmd"say""check" );
    
register_clcmd"say_team""check" );
    
    
toggle_tag register_cvar"gag_tag""0" );
    
point get_cvar_pointer"amx_show_activity" );
    
g_msgsaytext get_user_msgid"SayText" );
    
}

public 
plugin_cfg()
{
    static 
dir64 ];
    
get_localinfo"amxx_configsdir"dir63 );
    
formatexg_WordsFile 127 "%s/%s" dirg_FileName );
    
    if( !
file_existsg_WordsFile ) )
        
write_fileg_WordsFile"[Gag Words]", -);
        
    new 
Len;
    
    while( 
g_Count WORDS && read_fileg_WordsFileg_Count ,g_Wordsg_Count ][ ], 30Len ) )
    {
        
g_Wordsg_Count ][ ] = Len;
        
g_Count++;
    }
}

public 
gag_cmdidlevelcid )
{
    if( !
cmd_accessidlevelcid) )
        return 
PLUGIN_HANDLED;      
        
    new 
arg32 ], arg2], reason32 ];
    new 
name32 ], namet32 ];
    new 
minutes;
    
      
read_argv(1arg31)

      new 
player cmd_target(idarg9)

      if (!
player
          return 
PLUGIN_HANDLED
    
    read_argv
1argsizeof arg );
    
read_argv2arg2sizeof arg2 );
    
read_argv3reasonsizeof reason );
        
    
get_user_nameidname31 );
    
    
copyg_admin31name );
    
copyg_reason31reason );
    
remove_quotesreason );
    
    
minutes str_to_numarg2 );
    
    new 
target cmd_targetidarg10 );
    if( !
target)
        return 
PLUGIN_HANDLED;
    
    if( 
g_Gagedtarget ] )
    {
        
console_printid"Jucatorul are deja GAG!" );
        return 
PLUGIN_HANDLED;
    }
    
    
get_user_nametargetnamet31 );
    
copyg_nametarget ], 31namet );
    
    
g_CmdGagtarget ] = true;
    
g_Gaged[target] = true;
    
g_GagTimetarget ] = minutes;
    
    print( 
0"^x04[ADMIN] %s:^x01 GAG^x03 %s^x01 pentru^x03 [%d]^x01 minut(e). Motiv:^x03 %s",get_pcvar_numpoint ) == name ""nametminutesreason );
    
    if( 
get_pcvar_numtoggle_tag ) == )
    {
        new 
Buffer64 ];
        
formatexBuffersizeof Buffer 1"%s %s"tagnamet );
        
        
g_NameChangedtarget ] = true;
        
client_cmdtarget"name ^"%s^"",Buffer );
    }
    
    
set_task60.0"count"target 123__"b" );
    
    return 
PLUGIN_HANDLED;
}

public 
ungag_cmdid,levelcid )
{
    if( !
cmd_accessidlevelcid) )
        return 
PLUGIN_HANDLED;
        
    new 
arg32 ], reason32 ], name32 ];
    
read_argv1argsizeof arg );
    
read_argv2reasonsizeof reason );
    
get_user_nameidnamesizeof name );
    
remove_quotesreason );
    
    new 
target cmd_targetidarg11 );
    if( !
target )
        return 
PLUGIN_HANDLED;
    new 
namet32 ];
    
get_user_nametargetnametsizeof namet );
    
    if( !
g_Gagedtarget ] )
    {
        
console_printid"Jucatorul %s nu are GAG."namet );
        return 
PLUGIN_HANDLED;
    }
    
    
g_Gagedtarget ] = false;
    
g_SwearGagtarget ] = false;
    
    if( 
g_NameChangedtarget ] )
        
client_cmdtarget"name ^"%s^""g_nametarget ] );
        
    
g_NameChangedtarget ] = false;
    
    
remove_tasktarget 123 );
    
    print( 
0"^x04[ADMIN] %s:^x01 UNGAG ^x03 %s",get_pcvar_numpoint ) == name ""namet );
    
    return 
PLUGIN_HANDLED;
}
    
public 
counttask )
{
    new 
index task 123;
    if( !
is_user_connectedindex ) )
        return 
0;
        
    
g_GagTime[index] -= 1;
    
    if( 
g_GagTimeindex ] <= )
    {
        
remove_taskindex 123 );
        
        print( 
index"Ai primit UNGAG! Ai grija la limbaj! Scrie in chat ^x04/regulament^x01 ca sa afli regulile serverului." );
        
g_Gagedindex ] = false;
    
        if( 
g_NameChangedindex ] )
            
client_cmdindex"name ^"%s^""g_nameindex ] );
        
        return 
0;
    }
    
    return 
1;
}

public 
checkid )
{
    new 
said192 ];
    
read_argssaidsizeof said );
    
    if( !
strlensaid ) )
        return 
PLUGIN_CONTINUE;
        
    if( 
g_Gagedid ] )
    {
        if( 
g_CmdGagid ] )
        {
            print( 
id,"Ai GAG de la: %s timp de %d minut(e)" ,g_adming_GagTimeid ], g_GagTimeid ] == "" "s" );
            print( 
id,"Motivul Gagului: %s. ^x04RETRY = BAN 100^x01"g_reason );
            
            return 
PLUGIN_HANDLED;
        
        } else if( 
g_SwearGagid ] ) {
                  print( 
id"Ai GAG pentru limbaj vulgar sau reclama. ^x04RETRY = BAN 100^x01")
            print( 
id"Au mai ramas %d minut(e)",  g_GagTimeid ], g_GagTimeid ] == "" "s" );
            return 
PLUGIN_HANDLED;
        }
    } else {
        
        new 
bool:g_Swearedipos;
        
        for( 
0g_Count; ++)
        {
            if( ( 
pos containisaidg_Words][ ] ) ) != -)
            {
                
g_Len g_Words][ ];
                
                while( 
g_Len-- )
                    
saidpos++ ] = '*';
                    
                
g_Sweared true;
                continue;
            }
        }
        
        if( 
g_Sweared )
        {
            new 
cmd32 ], name32 ];
            
            
get_user_nameidnamesizeof name );
            
read_argv0cmdsizeof cmd );
            
copyg_nameid ], 31name );
            
            
engclient_cmdidcmdsaid );
            
g_Gagedid ] = true;
            
g_CmdGagid ] = false;
            
            if( 
get_pcvar_numtoggle_tag ) == )
            {
                new 
Buffer64 ];
                
formatexBuffersizeof Buffer 1"%s %s"tagname );
        
                
g_NameChangedid ] = true;
                
client_cmdid"name ^"%s^""Buffer) ;
            }
            
            
g_SwearGagid ] = true;
            
g_GagTimeid ] = SWEAR_GAGMINUTES;
            
            new 
Nick[32],Authid[35],usrip[32]
                 
get_user_name(id,Nick,31)
                
get_user_ip(id,usrip,31);
             
get_user_authid(id,Authid,34
             print(
0"^x04[war4.freakz.ro][ROBOT ADMIN]^x01 Jucatorul ^x03 %s^x01 a primit GAG.",Nick,usrip)
        
            
set_task60.0"count",id+123,_,_,"b");
            
            return 
PLUGIN_HANDLED;
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
client_disconnect(id

    if(
g_Gaged[id]) 
    {
     new 
Nick[32],Authid[35],usrip[32]
     
get_user_name(id,Nick,31)
     
get_user_ip(id,usrip,31);
     
get_user_authid(id,Authid,34
     print(
0"^x04[war4.freakz.ro]^x01 Jucatorul cu GAG^x03 %s^x01[IP:^x03 %s^x01] a parasit serverul.",Nick,usrip)        
        
     
g_Gagedid ] = false;
         
g_SwearGagid ] = false;    
         
remove_taskid );
        
    }
}

print( 
id, const message[ ], { FloatSqlResult}:... )
{
    new 
Buffer128 ], Buffer2128 ];
    
    
formatexBuffer2sizeof Buffer2 1"%s"message );
    
vformatBuffersizeof Buffer 1Buffer2);
    
    if( 
id )
    {
        
message_beginMSG_ONEg_msgsaytext_,id );
        
write_byteid );
        
write_stringBuffer) ;
        
message_end();
    
    } else {
        new 
players32 ], indexnumi;
        
get_playersplayersnum"ch" );
        
        for( 
0numi++ )
        {
            
index players];
            if( !
is_user_connectedindex ) ) continue;
            
            
message_beginMSG_ONEg_msgsaytext_index );
            
write_byteindex );
            
write_stringBuffer );
            
message_end();
        }
    }


Last edited by revox; 03-19-2010 at 12:16.
revox is offline
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 03-17-2010 , 19:10   Re: gag (admin immunity)
Reply With Quote #2

PHP Code:
cmd_target(idargx


PHP Code:
cmd_target(idargCMDTARGET_OBEY_IMMUNITY
__________________
"There is no knowledge, that is not power"
fezh is offline
revox
Member
Join Date: Feb 2010
Location: romania, bucharest
Old 03-17-2010 , 19:34   Re: gag (admin immunity)
Reply With Quote #3

that it's for admin immunity (ex: amx_gag revox 10 gag)

but the automatic gag it still gives gag if an admin with flag a it's saying for example "fuck"
revox is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-17-2010 , 22:15   Re: gag (admin immunity)
Reply With Quote #4

You want to gag the admin who has immunity? Seems a bit backwards lol.
__________________
fysiks is online now
revox
Member
Join Date: Feb 2010
Location: romania, bucharest
Old 03-18-2010 , 04:18   Re: gag (admin immunity)
Reply With Quote #5

you misunderstood me...
http://i456.photobucket.com/albums/q...ntitled-52.jpg

the plugin it's gives gag to anyone... admins/players/owners...
i want to make the plugin obey immunity (flag "a")

this part of the plugin it's gives automatic gag ..


PHP Code:
public checkid )
{
    new 
said192 ];
    
read_argssaidsizeof said );
    
    if( !
strlensaid ) )
        return 
PLUGIN_CONTINUE;
        
    if( 
g_Gagedid ] )
    {
        if( 
g_CmdGagid ] )
        {
            print( 
id,"Ai GAG de la: %s timp de %d minut(e)" ,g_adming_GagTimeid ], g_GagTimeid ] == "" "s" );
            print( 
id,"Motivul Gagului: %s. ^x04RETRY = BAN 100^x01"g_reason );
            
            return 
PLUGIN_HANDLED;
        
        } else if( 
g_SwearGagid ] ) {
                  print( 
id"Ai GAG pentru limbaj vulgar sau reclama. ^x04RETRY = BAN 100^x01")
            print( 
id"Au mai ramas %d minut(e)",  g_GagTimeid ], g_GagTimeid ] == "" "s" );
            return 
PLUGIN_HANDLED;
        }
    } else {
        
        new 
bool:g_Swearedipos;
        
        for( 
0g_Count; ++)
        {
            if( ( 
pos containisaidg_Words][ ] ) ) != -)
            {
                
g_Len g_Words][ ];
                
                while( 
g_Len-- )
                    
saidpos++ ] = '*';
                    
                
g_Sweared true;
                continue;
            }
        }
        
        if( 
g_Sweared )
        {
            new 
cmd32 ], name32 ];
            
            
get_user_nameidnamesizeof name );
            
read_argv0cmdsizeof cmd );
            
copyg_nameid ], 31name );
            
            
engclient_cmdidcmdsaid );
            
g_Gagedid ] = true;
            
g_CmdGagid ] = false;
            
            if( 
get_pcvar_numtoggle_tag ) == )
            {
                new 
Buffer64 ];
                
formatexBuffersizeof Buffer 1"%s %s"tagname );
        
                
g_NameChangedid ] = true;
                
client_cmdid"name ^"%s^""Buffer) ;
            }
            
            
g_SwearGagid ] = true;
            
g_GagTimeid ] = SWEAR_GAGMINUTES;
            
            new 
Nick[32],Authid[35],usrip[32]
                 
get_user_name(id,Nick,31)
                
get_user_ip(id,usrip,31);
             
get_user_authid(id,Authid,34
             print(
0"^x04[war4.freakz.ro][ROBOT ADMIN]^x01 Jucatorul ^x03 %s^x01 a primit GAG.",Nick,usrip)
        
            
set_task60.0"count",id+123,_,_,"b");
            
            return 
PLUGIN_HANDLED;
        }
    }
    
    return 
PLUGIN_CONTINUE;

revox is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-18-2010 , 17:33   Re: gag (admin immunity)
Reply With Quote #6

Edit it to look like this:

PHP Code:
public checkid )
{
    if( 
get_user_flags(id) & ADMIN_IMMUNITY )
        return 
PLUGIN_CONTINUE
    
    
new said192 ];
    
read_argssaidsizeof said ); 
__________________
fysiks is online now
revox
Member
Join Date: Feb 2010
Location: romania, bucharest
Old 03-18-2010 , 19:00   Re: gag (admin immunity)
Reply With Quote #7

who help me again and again...
fysiks
respect my friend
10x
revox 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 23:23.


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