Skip to content

Commit

Permalink
Set spectator as invincible while spectating
Browse files Browse the repository at this point in the history
  • Loading branch information
manups4e committed Sep 8, 2021
1 parent e56b184 commit ccb9114
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ESXSpectateControl.Client/Menu/MainMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public static async void Open(string jsonPlayers)
}
lastPosition = Game.PlayerPed.Position;
NetworkFadeOutEntity(Game.PlayerPed.Handle, true, false);
Game.PlayerPed.IsInvincible = true;
Game.PlayerPed.IsCollisionEnabled = false;
Game.PlayerPed.IsPositionFrozen = true;
Game.PlayerPed.Position = position;
Expand Down Expand Up @@ -168,6 +169,7 @@ public static async void Open(string jsonPlayers)
Game.PlayerPed.IsCollisionEnabled = true;
Game.PlayerPed.IsPositionFrozen = false;
NetworkFadeInEntity(Game.PlayerPed.Handle, false);
Game.PlayerPed.IsInvincible = false;
Game.PlayerPed.IsVisible = true;
MainScript.InSpectatorMode = false;
Screen.Fading.FadeIn(500);
Expand Down

0 comments on commit ccb9114

Please sign in to comment.