Raised This Month: $ Target: $400
 0% 

[SUG] Аdding cvar for the time and a timer


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 12-17-2011 , 16:46   [SUG] Аdding cvar for the time and a timer
Reply With Quote #1

Can somebody add me CVAR for the invisible time and a hud timer that countdowns the seconds according to the CVAR?

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

new g_bInvis

#define SetInvis(%1)        g_bInvis |= ( 1<<( %1&31 ) )
#define GetInvis(%1)      ( g_bInvis & ( 1<<( %1&31 ) ) )
#define RemoveInvis(%1)     g_bInvis &= ~( 1<<( %1&31 ) )

public plugin_init()
{
        
register_plugin"Invisible on Spawn""0.0.1""Exolent" )
    
        
register_forwardFM_AddToFullPack"FwdAddToFullPackPost")
    
        
RegisterHamHam_Spawn"player""FwdPlayerSpawnPost")
        
RegisterHamHam_Killed"player""FwdPlayerKilledPost")
}

public 
client_disconnectiPlayer )
{
        
remove_taskiPlayer )
    
        
RemoveInvisiPlayer )
}

public 
FwdAddToFullPackPostesHandleeiEntityiHostiHostFlagsiPlayerpSet )
{
        if( 
iPlayer )
        {
                if( 
iHost != iEntity
                
&&  get_orig_retval( )
                &&  
is_user_aliveiHost )
                &&  
is_user_aliveiEntity )
                &&  
GetInvisiEntity ) )
                {
                        
set_esesHandleES_OriginFloat:{ 9999999.0999999.0999999.0 } )

                        
set_esesHandleES_Effects, ( get_esesHandleES_Effects ) | EF_NODRAW ) )
                }
        }
}

public 
FwdPlayerSpawnPostiPlayer )
{
        if( 
is_user_aliveiPlayer ) )
        {
                
SetInvisiPlayer )
        
                
remove_taskiPlayer )
                
set_task10.0"TaskRemoveInvis"iPlayer )
        }
}

public 
FwdPlayerKilledPostiPlayer )
{
        
remove_taskiPlayer )
    
        
RemoveInvisiPlayer )
}

public 
TaskRemoveInvisiPlayer )
{
        
RemoveInvisiPlayer )


Last edited by Lolz0r; 12-18-2011 at 15:52.
Lolz0r is offline
 


Thread Tools
Display Modes

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:46.


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