Esempio n. 1
0
        public override void Update()
        {
            irFlares.Update();

            if (irFlaresRecharge.Enabled)
            {
                if (Game.GameTime > irFlaresRecharge.Waiter - 10000)
                {
                    UI.Notify("Flares Recharging!");
                }

                if (Game.GameTime > irFlaresRecharge.Waiter)
                {
                    UI.Notify("Flares Available.");
                    irFlaresRecharge.Enabled = false;
                    UIManager.SetHUDIcon(1, true);
                    PlayEquipSound(1);
                }
            }

            if (engineRepairRecharge.Enabled)
            {
                if (Game.GameTime > engineRepairRecharge.Waiter)
                {
                    UI.Notify("Fire Extinguisher Available.");
                    engineRepairRecharge.Enabled = false;
                    UIManager.SetHUDIcon(0, true);
                }
            }

            else if (engineFXTimer.Enabled)
            {
                ManagedVehicle.Vehicle.Repair();

                if (Game.GameTime > engineFXTimer.Waiter)
                {
                    engineSound.Stop();
                    engineFX1.Remove();
                    engineFXTimer.Enabled = false;
                    engineRepairRecharge.Start();
                    UI.Notify("Fire Extinguisher Recharging!");
                }
            }

            if (ManagedPed.IsDead)
            {
                TeamManager.RegisterScoreForTeam(Team, -250);
                PlayerStats.UpdatePlayerStats("deaths", 1);
                //    PlayerStats.UpdatePlayerStats("score", -250);
                GTA.Script.Wait(7000);
                Setup();
            }

            else if (Game.IsControlJustPressed(0, Config.GP_Ability1))
            {
                DoFireExtinguisher();
            }

            else if (Game.IsControlJustPressed(0, Config.GP_Ability2))
            {
                DoIRFlares();
            }

            else if (!ManagedVehicle.Vehicle.IsDriveable)
            {
                PlayerStats.UpdatePlayerStats("deaths", 1);
                Scripts.FadeOutScreen(1500, 2000);
                ManagedVehicle.Delete();
                Setup();
                Scripts.FadeInScreen(500, 1000);
            }

            else
            {
                if (ManagedVehicle.Position.DistanceTo(new Vector3(-248.9207f, -752.2429f, ManagedVehicle.Position.Z)) > 2000f && !tooFar)
                {
                    UIManager.Append("~r~Leaving The Combat Area!");
                    tooFar = true;
                }

                else if (tooFar && ManagedVehicle.Position.DistanceTo(new Vector3(-248.9207f, -752.2429f, ManagedVehicle.Position.Z)) < 2000f)
                {
                    UIManager.Clear();
                }

                else if (tooFar && ManagedVehicle.Position.DistanceTo(new Vector3(-248.9207f, -752.2429f, ManagedVehicle.Position.Z)) > 2500f)
                {
                    Scripts.FadeOutScreen(1500, 2000);
                    UIManager.Clear();
                    Setup();
                    Scripts.FadeInScreen(500, 1000);
                    tooFar = false;
                }

                else
                {
                    if (interpCam != null && !Function.Call <bool>(Hash.IS_CAM_RENDERING, interpCam.MainCamera.Handle))
                    {
                        ManagedVehicle.LandingGearState = LandingGearState.Closing;
                        interpCam.Destroy();
                        interpCam = null;
                    }

                    if (boostTimer.Enabled)
                    {
                        if (Game.GameTime > boostTimer.Waiter)
                        {
                            //kill the default flying music, make it more suspenseful.
                            SoundManager.Step();
                            ManagedVehicle.IsInvincible     = false;
                            boostTimer.Enabled              = false;
                            ManagedVehicle.LandingGearState = LandingGearState.Closing;
                        }

                        else
                        {
                            ManagedVehicle.ApplyForce(ManagedVehicle.ForwardVector * 0.87f);
                        }
                    }
                }
            }

            base.Update();
        }
Esempio n. 2
0
 /// <summary>
 /// Remove particle fx and delete the entity
 /// </summary>
 public void Remove()
 {
     ptfx.Remove();
     Delete();
 }