Hi all of you. I am trying to add the effect of a gun that smokes when overheated. The code compiles fine, the weapon on which I have added the code works fine, but the effect won´t show. What I have done is:
1st. Include
explode.h into the weapon´s includes.
2nd. In the Primary and Secondary fire function I added...
[quote]
if ( m_iHeat >= 200 )
{
#ifndef CLIENT_DLL//Whitout it cl.dll won´t compile!!
// lots of smoke
MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY );
WRITE_BYTE( TE_SMOKE );
WRITE_COORD( RANDOM_FLOAT( pev->absmin.x, pev->absmax.x ) );
WRITE_COORD( RANDOM_FLOAT( pev->absmin.y, pev->absmax.y ) );
WRITE_COORD( pev->origin.z);
WRITE_SHORT( g_sModelIndexSmoke );//Tried m_iSpriteTexture
WRITE_BYTE( 25 ); // scale * 10
WRITE_BYTE( 10 ); // framerate
MESSAGE_END();
#endif
}
[/quote]
...which is directly taken from
turret.cppAny ideas?. If I put it on the main conditional of the overheat code (thanks Solokiller and Shepard
) the game crashes.
I remember of it have worked in the first attempts I did on 2007 or 2008, but the smoke covered the player, it does not exit from the gun.
Then I discarded the code because the effect was shown when the ammo was less of 100 instead of happening when a certain number of degrees celsius overheated the weapon.
Pity I do not remember what I did to make this code work, 10 years are a lot to remember something like that...
Nowadays, if I try to put it on the primary or secondary fire function outside the conditional of above, the game crashes or freezes (remember, abbadon coding skills = 0.5 ). XD
Thanks in anticipation.