Raised This Month: $ Target: $400
 0% 

admin immunity into this small plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Rajo
New Member
Join Date: Dec 2011
Old 12-17-2011 , 13:24   admin immunity into this small plugin
Reply With Quote #1

Hello guys, I want make this plugin admin immunity...I try:
PHP Code:
#define FLAG_A ADMIN_IMMUNITY

if(get_user_flags(id) & ADMIN_IMMUNITY)
{
 
//code

but no effect...
PHP Code:
/* AMX Mod X 
*   Anti Reconnect Plugin 3.0 

*/ 
#include <amxmodx> 
#include <cstrike> 
#include <fun> 


new PLUGIN[]="Anti reconnect" 
new AUTHOR[]="JohnJ" 
new VERSION[]="3.0" 

new RTIME[]="amx_reconnect_time" 
new RCAN[]="amx_reconnect_can" 
new SCORESAVE[]="amx_reconnect_ss" 
new RSTATIC[]="amx_reconnect_static" 
new RSTIME[]="amx_reconnect_stime" 

new t_disconnect[33] = {0, ...} 
new 
t_scoresave[33] = {0, ...} 
new 
ips[33][24
new 
sfrags[33] = {0, ...} 
new 
sdeaths[33] = {0, ...} 
new 
useretry[33] = {0, ...} 

public 
plugin_init() 

    
register_plugin(PLUGINVERSIONAUTHOR
    
register_cvar(RTIME"300"
    
register_cvar(RCAN"0"
    
register_cvar(SCORESAVE"1"
    
register_cvar(RSTATIC"1"
    
register_cvar(RSTIME"900"
    
register_event("TeamInfo","outspec","a"


public 
client_connect(id

    new 
maxexit get_cvar_num(RTIME
    new 
maxstata get_cvar_num(RSTIME
    new 
canreconnect get_cvar_num(RCAN
    new 
ssave get_cvar_num(SCORESAVE
    new 
ip[24
    
get_user_ip(id,ip,23,0

    
    if ((
maxexit>0) && (canreconnect==0) && (equali(ip,ips[id]))) 
    { 
        new 
Float:nexTime get_gametime() 

        if (
t_disconnect[id] > nexTime
        { 
            new 
stat get_cvar_num(RSTATIC
            new 
timewait
            
if (stat==0
            { 
                
t_disconnect[id] = floatround(nexTime) + maxexit 
                t_scoresave
[id] = floatround(nexTime) + maxstata 
                timewait
=maxexit 
            

            else 
            { 
                
timewait=t_disconnect[id]-floatround(nexTime
            } 
            
server_cmd("kick #%d You can join into server for about  %d sec. ! "get_user_userid(id), timewait
            return 
PLUGIN_CONTINUE 
       
}
     } 
    if (
ssave==1
    { 
        new 
Float:nexTime get_gametime() 

        if (
t_scoresave[id] <= nexTime
        { 
            
sdeaths[id]=
            sfrags
[id]=
            useretry
[id]=
        

        return 
PLUGIN_CONTINUE 
    


    return 
PLUGIN_CONTINUE 


public 
outspec() 

    new 
id=read_data(1
    if ((
useretry[id]==1) && (is_user_connected(id))) 
    { 
        
cs_set_user_deaths(id,sdeaths[id]) 
        
set_user_frags(id,sfrags[id]) 
        
useretry[id]=
        sdeaths
[id]=
        sfrags
[id]=
    

    return 
PLUGIN_CONTINUE 


public 
client_disconnect(id

    new 
maxexit get_cvar_num(RTIME
    new 
maxstata get_cvar_num(RSTIME
    new 
ssave get_cvar_num(SCORESAVE

    new 
Float:theTime get_gametime() 
    
t_disconnect[id] = floatround(theTime) + maxexit 
    t_scoresave
[id] = floatround(theTime) + maxstata 
    get_user_ip
(id,ips[id],23,0

    if (
ssave==1
    { 
    
sdeaths[id] = get_user_deaths(id
    
sfrags[id] = get_user_frags(id
    
useretry[id]=
    

    return 
PLUGIN_CONTINUE 

Rajo 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 20:49.


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