public static async void SwitchToBriefing() { await UI.ShowLoadDisplay(); Freeze(true); Invisible(true); float spawnX = (float)await Sync.Data.Get(GetServerId(), "spawnPosX"); float spawnY = (float)await Sync.Data.Get(GetServerId(), "spawnPosY"); float spawnZ = (float)await Sync.Data.Get(GetServerId(), "spawnPosZ"); float spawnRot = (float)await Sync.Data.Get(GetServerId(), "spawnRot"); NetworkSetVoiceChannel(0); Respawn(new Vector3(spawnX, spawnY, spawnZ), spawnRot, true, false); await Delay(5000); Freeze(false); Invisible(false); MenuList.ShowWeaponShopMenu(); await UI.HideLoadDisplay(); }
public static async void StartGame(int traitor1, int traitor2, int traitor3, int traitor4, int detective1, int detective2, int gameTimer, int camType) { User.SetStatusType(StatusTypes.InGame); await Delay(500); User.GameInfo.Active = true; User.GameInfo.CamType = camType; User.GameInfo.Timer = gameTimer; User.GameInfo.Traitor1 = traitor1; User.GameInfo.Traitor2 = traitor2; User.GameInfo.Traitor3 = traitor3; User.GameInfo.Traitor4 = traitor4; User.GameInfo.Detective1 = detective1; User.GameInfo.Detective2 = detective2; var playerId = User.GetServerId(); if (playerId == User.GameInfo.Traitor1) { User.GameInfo.PlayerType = PlayerTypes.Traitor; } else if (playerId == User.GameInfo.Traitor2) { User.GameInfo.PlayerType = PlayerTypes.Traitor; } else if (playerId == User.GameInfo.Traitor3) { User.GameInfo.PlayerType = PlayerTypes.Traitor; } else if (playerId == User.GameInfo.Traitor4) { User.GameInfo.PlayerType = PlayerTypes.Traitor; } else if (playerId == User.GameInfo.Detective1) { User.GameInfo.PlayerType = PlayerTypes.Detective; } else if (playerId == User.GameInfo.Detective2) { User.GameInfo.PlayerType = PlayerTypes.Detective; } else { User.GameInfo.PlayerType = PlayerTypes.Innocent; } if (User.GameInfo.PlayerType == PlayerTypes.Traitor) { MenuList.ShowWeaponShopMenu("Special"); } Sync.Data.Set(User.GetServerId(), "playerType", User.GameInfo.PlayerType); }