Raised This Month: $ Target: $400
 0% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
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
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 01-02-2012 , 17:00   Re: [SUG] Аdding cvar for the time and a timer
Reply With Quote #2

Bump.
Lolz0r is offline
eskemo
Senior Member
Join Date: Dec 2008
Location: Australia
Old 01-02-2012 , 18:04   Re: [SUG] Аdding cvar for the time and a timer
Reply With Quote #3

Not really sure if that will work xD
try it i guess.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

new g_bInvistimer;

#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")
    
timer register_cvar("invisible_time""10.0");
}

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 )
{
new 
timer1 get_pcvar_num(timer);
if( 
is_user_aliveiPlayer ) )
{
    
SetInvisiPlayer )
    
    
remove_taskiPlayer )
    
set_tasktimer1 "TaskRemoveInvis"iPlayer )
}
}

public 
FwdPlayerKilledPostiPlayer )
{
remove_taskiPlayer )

RemoveInvisiPlayer )
}

public 
TaskRemoveInvisiPlayer )
{
RemoveInvisiPlayer )

__________________


Free Australian FASTDL Server PM ME
eskemo is offline
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 01-02-2012 , 18:16   Re: [SUG] Аdding cvar for the time and a timer
Reply With Quote #4

Yes, but hud timer-a?

Last edited by Lolz0r; 01-02-2012 at 18:17.
Lolz0r is offline
eskemo
Senior Member
Join Date: Dec 2008
Location: Australia
Old 01-02-2012 , 18:48   Re: [SUG] Аdding cvar for the time and a timer
Reply With Quote #5

erm what? I am not a good scripter sorry btw did that work at all?
__________________


Free Australian FASTDL Server PM ME
eskemo is offline
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 01-18-2012 , 09:00   Re: [SUG] Аdding cvar for the time and a timer
Reply With Quote #6

Please, help me.
Lolz0r 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 20:46.


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