private void ExitVehicle(object sender, EntityChangedEventArgs e) { Scripts.FadeOutScreen(1500, 2000); ManagedVehicle.Delete(); Setup(); Scripts.FadeInScreen(500, 1000); }
private void EnterWater(object sender, EntityChangedEventArgs e) { PlayerStats.UpdatePlayerStats("deaths", 1); Scripts.FadeOutScreen(1500, 2000); ManagedVehicle.Delete(); Setup(); Scripts.FadeInScreen(500, 1000); }
public static void InitializeScript() { Scripts.FadeOutScreen(1500, 800); World.GetAllVehicles().ToList().ForEach(x => x.Delete()); Function.Call(Hash._DISABLE_AUTOMATIC_RESPAWN, true); Function.Call(Hash._0x8BF907833BE275DE, 2.0f, 2.0f); UIManager.Enabled = true; TeamManager.Enabled = true; TeamManager.GetNewTeams(); LocalPlayer.Manage(new ManageablePed(Game.Player.Character), null); TeamManager.SetupTeam(LocalPlayer); LocalPlayer.Setup(); Scripts.FadeInScreen(0, 1900); scriptActive = true; }
public void StartRoutine() { if (targetEntities.Count < 0) { throw new Exception("Missile::EnterView: No targets."); } Scripts.FadeOutScreen(200, 200); var spawnOrigin = Position - new Vector3(0, 0, 500.0f); var direction = spawnOrigin - Position; var spawnRotation = Utils.DirectionToRotation(direction); Rotation = spawnRotation; newRotation = spawnRotation; mainCamera.Shake(CameraShake.Vibrate, 4f); mainCamera.MotionBlurStrength = 10.0f; World.RenderingCamera = mainCamera; soundLoop1.Play(this); if (nightVision) { Function.Call(Hash.SET_NIGHTVISION, true); } active = true; Scripts.FadeInScreen(200, 200); }
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(); }