Raised This Month: $ Target: $400
 0% 

[REQ] Light + HP Regen Nade


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FireJinTW
Senior Member
Join Date: Jan 2012
Old 08-06-2015 , 21:05   [REQ] Light + HP Regen Nade
Reply With Quote #1

According to this thread: https://forums.alliedmods.net/showth...ght=light+nade

How can I add HP Regen to the teammate if they are around the radius of the light?

PHP Code:
#include < amxmodx >

#include < fakemeta >
#include < engine >
#include < fun >
#include < hamsandwich >

#pragma semicolon 1    

#define SMOKE_ID        071192
#define pev_valid2(%1)        ( pev( %1, pev_iuser4 ) == SMOKE_ID ) ? 1 : 0

new gSmokeLightEnable;
new 
gLightTime;
new 
gDeployTime;
new 
gSpriteTrail;
new 
gSpriteCircle;
new 
gSpriteSmoke;
new 
gTrailEnable;
new 
gCylinderEnable;
new 
gGlowColorCvar;
new 
gSmokeCvar;
new 
gSmokeBonus;

new 
Float:flOrigin];
new 
iOrigin];

new const 
gSmokeModel[ ] = "models/w_flashbang.mdl";

new const 
gSmokeStartSound[ ] = "items/nvg_on.wav";
new const 
gSmokeStopSound[ ] = "items/nvg_off.wav";

public 
plugin_init( )
{
    
register_plugin"Light Smoke Grenade""2.0.0""tuty" );
    
    
register_forwardFM_SetModel"forward_SetModel" );
    
register_forwardFM_Think"forward_Think" );
    
    
RegisterHamHam_Spawn"player""bacon_Spawn");
    
    
gSmokeLightEnable register_cvar"lightsmoke_enabled""1" );
    
gLightTime register_cvar"lightsmoke_light_duration""20.0" );
    
gDeployTime register_cvar"lightsmoke_deploytime""3.0" );
    
gTrailEnable register_cvar"lightsmoke_trail""1" );
    
gCylinderEnable register_cvar"lightsmoke_cylinder""1" );
    
gSmokeCvar register_cvar"lightsmoke_smoke""1" );
    
gGlowColorCvar register_cvar"lightsmoke_glow_color""255 255 255" );
    
gSmokeBonus register_cvar"lightsmoke_bonus""1" );
}

public 
plugin_precache( )
{
    
gSpriteTrail precache_model"sprites/laserbeam.spr" );
    
gSpriteCircle precache_model"sprites/shockwave.spr" );
    
gSpriteSmoke precache_model"sprites/steam1.spr" );
    
    
precache_modelgSmokeModel );
    
    
precache_soundgSmokeStartSound );
    
precache_soundgSmokeStopSound );
}

public 
bacon_Spawnid )
{
    if( 
is_user_aliveid 
    && 
get_pcvar_numgSmokeLightEnable ) == 
    
&& get_pcvar_numgSmokeBonus ) == )
    {
        
give_itemid"weapon_flashbang" );
    }
}    

public 
forward_SetModeliEnt, const szModel[ ] )
{
    if( !
pev_validiEnt 
    || 
get_pcvar_numgSmokeLightEnable ) == 
    
|| !equalszModel], "flashbang.mdl" ) )
    {
        return 
FMRES_IGNORED;
    }
    
    static 
szClassname32 ];
    
peviEntpev_classnameszClassnamecharsmaxszClassname ) );
    
    if( 
equalszClassname"grenade" ) )
    {
        if( 
get_pcvar_numgTrailEnable ) == )
        {
            
UTIL_TrailSpriteiEnt );
        }
        
        
engfuncEngFunc_SetModeliEntgSmokeModel );
        
set_taskget_pcvar_floatgDeployTime ), "deploy_smoke"iEnt );
        
        
set_peviEntpev_iuser4SMOKE_ID );
        
set_peviEntpev_nextthinkget_gametime( ) + get_pcvar_floatgLightTime ) );
        
        new 
szColor12 ], iRgb][ ], iRiGiB;
        
get_pcvar_stringgGlowColorCvarszColorcharsmaxszColor ) );
        
        
parseszColoriRgb], 3iRgb], 3iRgb], );
        
        
iR clampstr_to_numiRgb] ) , 0255 );
        
iG clampstr_to_numiRgb] ) , 0255 );
        
iB clampstr_to_numiRgb] ) , 0255 );
        
        
set_renderingiEntkRenderFxGlowShelliRiGiBkRenderNormal18 );
        
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;
}

public 
deploy_smokeiEnt )
{
    if( 
pev_validiEnt ) )
    {
        if( 
get_pcvar_numgCylinderEnable ) == )
        {
            
UTIL_BlastCircleiEnt );
        }
        
        
set_peviEntpev_effectsEF_DIMLIGHT );
        
emit_soundiEntCHAN_ITEMgSmokeStartSoundVOL_NORMATTN_NORM0PITCH_NORM );
    }
}

public 
forward_ThinkiEnt )
{
    if( 
pev_validiEnt 
    && 
get_pcvar_numgSmokeLightEnable ) == 
    
&& pev_valid2iEnt ) )
    {
        if( 
get_pcvar_numgSmokeCvar ) == )
        {
            
peviEntpev_originflOrigin );
            
FVecIVecflOriginiOrigin );
            
            new 
iOrigin];
            new 
iOrigin];
            new 
iOrigin];
            
            
UTIL_Smoke50y);
            
UTIL_Smokex50);
            
UTIL_Smoke50y);
            
UTIL_Smokex50);
            
UTIL_Smoke3535);
            
UTIL_Smoke3535);
            
UTIL_Smoke3535);
            
UTIL_Smoke3535);
        }
        
        
emit_soundiEntCHAN_ITEMgSmokeStopSoundVOL_NORMATTN_NORM0PITCH_NORM );
        
set_peviEntpev_flagsFL_KILLME );
    }
}

stock UTIL_TrailSpriteent )
{
    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byteTE_BEAMFOLLOW );
    
write_shortent );        
    
write_shortgSpriteTrail );
    
write_byte);
    
write_byte);
    
write_byte255 );
    
write_byte255 );
    
write_byte255 );
    
write_byte100 );
    
message_end( );
}

stock UTIL_BlastCircleent )
{
    
peventpev_originflOrigin );
    
FVecIVecflOriginiOrigin );
    
    
message_beginMSG_BROADCASTSVC_TEMPENTITYiOrigin ); 
    
write_byteTE_BEAMCYLINDER );
    
write_coordiOrigin] );
    
write_coordiOrigin] );
    
write_coordiOrigin] );
    
write_coordiOrigin] );
    
write_coordiOrigin] );
    
write_coordiOrigin] + 220 ) ;
    
write_shortgSpriteCircle );
    
write_byte);
    
write_byte);
    
write_byte);
    
write_byte);
    
write_byte);
    
write_byte255 );
    
write_byte255 );
    
write_byte255 );
    
write_byte128 );
    
write_byte);
    
message_end( );
}

stock UTIL_Smokexy)
{
    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byteTE_SMOKE );
    
write_coord);
    
write_coord);
    
write_coord); 
    
write_shortgSpriteSmoke );
    
write_byte12 );
    
write_byte);
    
message_end( );


Thanks in Advance
FireJinTW is offline
FireJinTW
Senior Member
Join Date: Jan 2012
Old 08-13-2015 , 07:30   Re: [REQ] Light + HP Regen Nade
Reply With Quote #2

Just wondering the code from this plugin: https://forums.alliedmods.net/showth...54448?p=854448

About Medic - Heals teammates around you. Will it work if I try to use that for Light Nade?
FireJinTW is offline
FireJinTW
Senior Member
Join Date: Jan 2012
Old 08-27-2015 , 06:21   Re: [REQ] Light + HP Regen Nade
Reply With Quote #3

Bump - Anyone are able to do, please help.

Thanks in Advance
FireJinTW 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 13:35.


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