Raised This Month: $ Target: $400
 0% 

glow Smoke Grenade


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mr.Waffle
Senior Member
Join Date: Dec 2011
Old 04-29-2012 , 14:07   glow Smoke Grenade
Reply With Quote #1

hello,
code
PHP Code:
public Forward_EntityThink_PreiEnt )  {         
    new 
id peviEntpev_owner );    
        
    new 
sModel32 ];
    
    
peviEntpev_modelsModelcharsmaxsModel ) );
    
    if( 
equalsModel"models/w_smokegrenade.mdl" ) ) { 
        
set_peviEntpev_renderfxkRenderFxGlowShell );
        
set_peviEntpev_renderamt125.0 );
        
set_peviEntpev_rendermodekRenderTransAlpha );
        
        if(
cs_get_user_team(iEnt) == CS_TEAM_CT)
        {
            
pev(iEntpev_rendercolor0.00.0255.0
        }
        if(
cs_get_user_team(iEnt) == CS_TEAM_T)    
        {
            
pev(iEntpev_rendercolor255.00.00.0
        }        
        return 
FMRES_SUPERCEDE;
    }    
    return 
FMRES_IGNORED;

so why its not working ?
i just trying to do if a player throw a smoke grenade , the smoke grenade will be in glow .
teror = red glow
ct = blue glow .
can somone fix it ?
thx .

Last edited by Mr.Waffle; 04-29-2012 at 14:36.
Mr.Waffle is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 04-29-2012 , 14:33   Re: glow Smoke Grenade
Reply With Quote #2

I would rather hook SetModel or Spawn.
Anyway you have some errors:

- In charsmax it should be sModel (or szModel if you replace it in the other places)
- In cs_get_user_team the index should be id, not iEnt.
- Optional: You could use elseif (because you need only one condition, player can't be T and CT at the same time) or a conditional operator for setting the colors.
__________________

Last edited by <VeCo>; 04-29-2012 at 14:34.
<VeCo> is offline
Mr.Waffle
Senior Member
Join Date: Dec 2011
Old 04-29-2012 , 14:43   Re: glow Smoke Grenade
Reply With Quote #3

i changed what u said, and it stell not working :s
PHP Code:
public Forward_EntityThink_PreiEnt )  {         
    new 
id peviEntpev_owner );    
        
    new 
sModel32 ];
    
    
peviEntpev_modelsModelcharsmaxsModel ) );
    
    if( 
equalsModel"models/w_smokegrenade.mdl" ) ) 
    { 
        
set_peviEntpev_renderfxkRenderFxGlowShell );
        
set_peviEntpev_renderamt125.0 );
        
set_peviEntpev_rendermodekRenderTransAlpha );
        
        if(
cs_get_user_team(id) == CS_TEAM_CT)
        {
            
pev(iEntpev_rendercolor0.00.0255.0
        }
        else if(
cs_get_user_team(id) == CS_TEAM_T)    
        {
            
pev(iEntpev_rendercolor255.00.00.0
        }        
        return 
FMRES_SUPERCEDE;
    }    
    return 
FMRES_IGNORED;

Quote:
I would rather hook SetModel or Spawn.
i use this "FM_Think", Because I want to block the explode of the smoke grenade.

Last edited by Mr.Waffle; 04-29-2012 at 14:46.
Mr.Waffle is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 04-29-2012 , 15:14   Re: glow Smoke Grenade
Reply With Quote #4

I forgot to say that you should use set_pev instead of pev for rendercolor.

For blocking the explosion you can set pev_dmgtime to a higher value or removing the FL_ONGROUND flag:
PHP Code:
set_pev(iEnt,pev_flags,pev(iEnt,pev_flags) & ~FL_ONGROUND 
__________________

Last edited by <VeCo>; 04-29-2012 at 15:15.
<VeCo> is offline
Mr.Waffle
Senior Member
Join Date: Dec 2011
Old 04-29-2012 , 15:29   Re: glow Smoke Grenade
Reply With Quote #5

omg , its working
Thank you .
1 more question,
why its not block the smoke explode :
PHP Code:
return FMRES_SUPERCEDE
?

NVM , SOLVED ..
THX U FOR THE HELP!

Last edited by Mr.Waffle; 04-29-2012 at 15:34.
Mr.Waffle is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 04-29-2012 , 15:36   Re: glow Smoke Grenade
Reply With Quote #6

Grenades never think.
__________________
<VeCo> 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 07:49.


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