Hello
I think that I have stopped modding mw2 for the following months, this was the last thing I made, the last time was working more or less well, I added 2 more dvars to see if the effect can improve but I couldnt try that, , if someone can try it and improve it, tell me here:
[hide][/hide]
I think that I have stopped modding mw2 for the following months, this was the last thing I made, the last time was working more or less well, I added 2 more dvars to see if the effect can improve but I couldnt try that, , if someone can try it and improve it, tell me here:
[hide]
Code:
SpawnJet()
{
self endon( "death" );
self endon( "disconnect" );
self thread JumpButtonPressed();
self thread ForwardButtonPressed();
self thread BackwardButtonPressed();
self thread LeftButtonPressed();
self thread RightButtonPressed();
plane = spawnplane( self, "script_model", self.origin, "compass_objpoint_airstrike_friendly", "compass_objpoint_airstrike_busy" );
plane setModel( "vehicle_mig29_desert" );
plane EnableLinkTo();
plane Solid();
plane.owner = self;
wait ( 0.05 );
self PlayerLinkTo( plane );
self.hasjet = 1;
self SetStance( "crouch" );
self hide();
self _disableWeapon();
self _disableOffhandWeapons();
self _disableWeaponSwitch();
self _disableUsability();
self setClientDvars( "cg_thirdPerson", 1, "cg_thirdPersonRange", 1024 );
self freezecontrols(true);
wait ( 0.05 );
plane PlayLoopSound( "veh_mig29_dist_loop" );
plane thread JetFX();
while( 1 )
{
// W
if ( self.forwardbuttonpressed == 1 && self.backwardbuttonpressed == 0 && self.leftbuttonpressed == 0 && self.rightbuttonpressed == 0 )
plane.pitch = plane.angles[0] - 5;
// S
if ( self.forwardbuttonpressed == 0 && self.backwardbuttonpressed == 1 && self.leftbuttonpressed == 0 && self.rightbuttonpressed == 0 )
plane.pitch = plane.angles[0] + 5;
// A
if ( self.forwardbuttonpressed == 0 && self.backwardbuttonpressed == 0 && self.leftbuttonpressed == 1 && self.rightbuttonpressed == 0 )
{
plane.yaw = plane.angles[1] + 5;
plane.roll = plane.angles[2] - 5;
}
// D
if ( self.forwardbuttonpressed == 0 && self.backwardbuttonpressed == 0 && self.leftbuttonpressed == 0 && self.rightbuttonpressed == 1 )
{
plane.yaw = plane.angles[1] - 5;
plane.roll = plane.angles[2] + 5;
}
// A + W
if ( self.forwardbuttonpressed == 1 && self.backwardbuttonpressed == 0 && self.leftbuttonpressed == 1 && self.rightbuttonpressed == 0 )
plane.yaw = plane.angles[1] + 5;
// D + W
if ( self.forwardbuttonpressed == 1 && self.backwardbuttonpressed == 0 && self.leftbuttonpressed == 0 && self.rightbuttonpressed == 1 )
plane.yaw = plane.angles[1] - 5;
// A + S
if ( self.forwardbuttonpressed == 0 && self.backwardbuttonpressed == 1 && self.leftbuttonpressed == 1 && self.rightbuttonpressed == 0 )
plane.yaw = plane.angles[1] - 5;
// D + S
if ( self.forwardbuttonpressed == 0 && self.backwardbuttonpressed == 1 && self.leftbuttonpressed == 0 && self.rightbuttonpressed == 1 )
plane.yaw = plane.angles[1] + 5;
// Rotate and Move
plane RotateTo( ( plane.pitch, plane.yaw, plane.roll ), 0.08 );
self setPlayerAngles( plane.angles );
plane MoveTo( plane.origin + anglestoforward( plane.angles ) * 300, 0.08 );
wait ( 0.08 );
}
}
JetFX()
{
self endon("destroyed");
self endon ( "death" );
PlayFXOnTag( level.fx_airstrike_afterburner, self, "tag_engine_right" );
wait ( 0.5 );
PlayFXOnTag( level.fx_airstrike_afterburner, self, "tag_engine_left" );
wait ( 0.5 );
PlayFXOnTag( level.fx_airstrike_contrail, self, "tag_right_wingtip" );
wait ( 0.5 );
PlayFXOnTag( level.fx_airstrike_contrail, self, "tag_left_wingtip" );
}
JumpButtonPressed()
{
self endon( "death" );
self endon( "disconnect" );
self notifyOnPlayerCommand("jumpA","+gostand");
self notifyOnPlayerCommand("jumpB","-gostand");
self.JumpButtonPressed = 0;
for(;;)
{
self waittill("jumpA");
self.JumpButtonPressed = 1;
self waittill("jumpB");
self.JumpButtonPressed = 0;
}
}
ForwardButtonPressed()
{
self endon( "death" );
self endon( "disconnect" );
self notifyOnPlayerCommand("ForwardA","+forward");
self notifyOnPlayerCommand("ForwardB","-forward");
self.ForwardButtonPressed = 0;
for(;;)
{
self waittill("ForwardA");
self.ForwardButtonPressed = 1;
self waittill("ForwardB");
self.ForwardButtonPressed = 0;
}
}
BackwardButtonPressed()
{
self endon( "death" );
self endon( "disconnect" );
self notifyOnPlayerCommand("backA","+back");
self notifyOnPlayerCommand("backB","-back");
self.BackwardButtonPressed = 0;
for(;;)
{
self waittill("backA");
self.BackwardButtonPressed = 1;
self waittill("backB");
self.BackwardButtonPressed = 0;
}
}
LeftButtonPressed()
{
self endon( "death" );
self endon( "disconnect" );
self notifyOnPlayerCommand("leftA","+moveleft");
self notifyOnPlayerCommand("leftB","-moveleft");
self.LeftButtonPressed = 0;
for(;;)
{
self waittill("leftA");
self.LeftButtonPressed = 1;
self waittill("leftB");
self.LeftButtonPressed = 0;
}
}
RightButtonPressed()
{
self endon( "death" );
self endon( "disconnect" );
self notifyOnPlayerCommand("rightA","+moveright");
self notifyOnPlayerCommand("rightB","-moveright");
self.RightButtonPressed = 0;
for(;;)
{
self waittill("rightA");
self.RightButtonPressed = 1;
self waittill("rightB");
self.RightButtonPressed = 0;
}
}