AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [SUG] Аdding cvar for the time and a timer (https://forums.alliedmods.net/showthread.php?t=174248)

Lolz0r 12-17-2011 16:46

[SUG] Аdding cvar for the time and a timer
 
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 )



Lolz0r 01-02-2012 17:00

Re: [SUG] Аdding cvar for the time and a timer
 
Bump.

eskemo 01-02-2012 18:04

Re: [SUG] Аdding cvar for the time and a timer
 
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 )



Lolz0r 01-02-2012 18:16

Re: [SUG] Аdding cvar for the time and a timer
 
Yes, but hud timer-a? :3

eskemo 01-02-2012 18:48

Re: [SUG] Аdding cvar for the time and a timer
 
erm what? I am not a good scripter sorry btw did that work at all?

Lolz0r 01-18-2012 09:00

Re: [SUG] Аdding cvar for the time and a timer
 
Please, help me.


All times are GMT -4. The time now is 20:46.

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