10-27-2010, 07:21
(This post was last modified: 11-07-2010, 11:43 by SuperNovaAO.)
[Release] Jet pack
by Lost4468
init()
on playerspawned
by Lost4468
init()
Code:
level.fx[0]=loadfx("fire/fire_smoke_trail_m");
level.fx[1]=loadfx("fire/tank_fire_engine");
level.fx[2]=loadfx("smoke/smoke_trail_black_heli");
on playerspawned
Code:
jetpack()
{
self endon("death");
self.jetpack=80;
JETPACKBACK = createPrimaryProgressBar( -275 );
JETPACKBACK.bar.x = 40;
JETPACKBACK.x = 100;
JETPACKTXT = createPrimaryProgressBarText( -275 );
JETPACKTXT.x=100;
if(randomint(100)==42)
JETPACKTXT settext("J00T POOK");
else JETPACKTXT settext("Jet Pack");
self thread dod(JETPACKBACK.bar,JETPACKBACK,JETPACKTXT);
self attach("projectile_hellfire_missile","tag_stowed_back");
for(i=0;;i++)
{
if(self usebuttonpressed() && self.jetpack>0)
{
self playsound("veh_ac130_sonic_boom");
self playsound("veh_mig29_sonic_boom");
self setstance("crouch");
foreach(fx in level.fx)
playfx(fx,self gettagorigin("j_spine4"));
earthquake(.15,.2,self gettagorigin("j_spine4"),50);
self.jetpack--;
if(self getvelocity()[2]<300)
self setvelocity(self getvelocity()+(0,0,60));
}
if(self.jetpack<80 &&!self usebuttonpressed())
{
self.fx1 delete();
self.fx2 delete();
self.jetpack++;
}
JETPACKBACK updateBar(self.jetpack/80);
JETPACKBACK.bar.color=(1,self.jetpack/80,self.jetpack/80);
wait .05;
}
}
dod(a,b,c)
{
self waittill("death");
a destroy();
b destroy();
c destroy();
}