Wayback Machine
OCT MAY Jun
Previous capture 5 Next capture
2004 2006 2007
14 captures
6 Oct 02 - 5 May 06
sparklines
Close Help

# menu
 
http://www.planethalflife.com/hlprogramming > tutorials > database 

news
 
current
 
submit

tutorials
 
database
  -
mp
  -
client
 
submit
 
search

forum
 
main

contact
 
email

Instant Firering Rockets (like in TFC)
Created by Jmv_cyber



HalfLife's Code is BLUE
Jmv_cyber's Code is RED
Jmv_cyber's Commentary is GREEN

This is my second tutorial, and believe me, it''s easy.

First, open up "rpg.cpp" and find this function:

void CRpgRocket :: Spawn( void )
{
Precache( );
// motor
pev->movetype = MOVETYPE_BOUNCE;
pev->solid = SOLID_BBOX;

SET_MODEL(ENT(pev), "models/rpgrocket.mdl");
UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0));
UTIL_SetOrigin( pev, pev->origin );

pev->classname = MAKE_STRING("rpg_rocket");

SetThink( IgniteThink );
SetTouch( ExplodeTouch );

pev->angles.x -= 30;
UTIL_MakeVectors( pev->angles );
pev->angles.x = -(pev->angles.x + 30);

pev->velocity = gpGlobals->v_forward * 250;
pev->gravity = 0.5;

pev->nextthink = gpGlobals->time + 0.4;

pev->dmg = gSkillData.plrDmgRPG;
}


Replace the entire function with this:

void CRpgRocket :: Spawn( void )
{
Precache( );
pev->movetype = MOVETYPE_BOUNCE;
pev->solid = SOLID_BBOX;

SET_MODEL(ENT(pev), "models/rpgrocket.mdl");
UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0));
UTIL_SetOrigin( pev, pev->origin );

pev->classname = MAKE_STRING("rpg_rocket");

SetThink( IgniteThink );
SetTouch( ExplodeTouch );

pev->angles.x -= 0;
UTIL_MakeVectors( pev->angles );
pev->angles.x = -(pev->angles.x + 0);

pev->velocity = gpGlobals->v_forward * 450;
pev->gravity = 0.5;

pev->nextthink = gpGlobals->time + 0.0;

pev->dmg = gSkillData.plrDmgRPG;
}


and it should work :)
If u get any errors, just e-mail me. This code is to be used by anyone who thinks it could be at use, and because of that i won''t take any credit for it