protected void Outside() { fringe.OutsideInterior(); foreach (Apartment apt in entires) { if (PlayerIsInRangeSquared(apt.EnterOutside, EnterOutsideActivationRange)) { CurrentApartment = apt; State = PlayerApartmentState.AtEnterOutside; break; } } }
protected async Task TransitionOutside() { Screen.Fading.FadeOut(200); while (!Screen.Fading.IsFadedOut) { await Delay(1); } await TeleportPlayerTo(CurrentApartment.ExitOutside, 1f); Game.Player.CanControlCharacter = true; Game.PlayerPed.IsInvincible = false; Screen.Fading.FadeIn(200); while (!Screen.Fading.IsFadedIn) { await Delay(1); } State = PlayerApartmentState.Outside; }
protected void BeginTransitionInside(Player owner = null) { State = PlayerApartmentState.TransitionInside; Game.Player.CanControlCharacter = false; Game.PlayerPed.IsInvincible = true; Game.PlayerPed.Weapons.Select(PlayerGenerics.Unarmed); PlayerGenerics.SetFlag(Game.Player, PlayerFlag.Hidden, true); PlayerGenerics.SetFlag(Game.Player, PlayerFlag.BlipHidden, true); PlayerInterior.SetInteriorId(Game.Player, CurrentApartment.InteriorId); if (owner == null) { PlayerInterior.SetInterOwnerToMyself(Game.Player); } else { PlayerInterior.SetInteriorOwner(Game.Player, owner); } }
protected void AtEnterOutside() { // If player stepped outside switch state to outside if (!PlayerIsInRangeSquared(CurrentApartment.EnterOutside, EnterOutsideActivationRange)) { CurrentApartment = null; State = PlayerApartmentState.Outside; return; } BeginTransitionInside(); // Uncomment when lazy tard will make a menu... //var playersInside = GetOwnersInsideInterior(CurrentApartment.InteriorId); //if (playersInside.Count == 0) { // BeginTransitionInside(); //} else { // ShowOwnerSelectionMenu(playersInside); //} }
protected async Task TransitionInside() { Screen.Fading.FadeOut(200); while (!Screen.Fading.IsFadedOut) { await Delay(1); } await TeleportPlayerTo(CurrentApartment.EntranceInside, 1f); await PlayerInterior.Load(CurrentApartment.InteriorId); Screen.Fading.FadeIn(200); while (!Screen.Fading.IsFadedIn) { await Delay(1); } Game.Player.CanControlCharacter = true; State = PlayerApartmentState.Inside; }
protected void BeginTransitionOutside() { State = PlayerApartmentState.TransitionOutside; Game.Player.CanControlCharacter = false; }