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
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
 



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