public static async void StopGame(int winner, bool isVoteMap)
        {
            if (PlayerTypes.Innocent == winner)
            {
                if (User.GameInfo.PlayerType == PlayerTypes.Innocent || User.GameInfo.PlayerType == PlayerTypes.Detective)
                {
                    User.AddCashMoney(5000);
                }
                UI.ShowMissionPassedMessage("~g~Innocent win", 20000);
                Notification.Send("~g~Innocent win");
            }
            else if (PlayerTypes.Traitor == winner)
            {
                if (User.GameInfo.PlayerType == PlayerTypes.Traitor)
                {
                    User.AddCashMoney(5000);
                }
                UI.ShowMissionPassedMessage("~r~Traitor win", 20000);
                Notification.Send("~r~Traitor win");
            }

            await Delay(10000);

            if (isVoteMap)
            {
                MenuList.ShowVoteMapMenu();
                await Delay(30000);

                MenuList.HideMenu();
                await Delay(5000);
            }

            User.SetStatusType(StatusTypes.Lobby);
        }
Exemple #2
0
        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);
        }
        public static async void SwitchToLobby()
        {
            await UI.ShowLoadDisplay();

            Sync.Data.Set(-1, "StartTimer", 121);
            Respawn(WaitLobby, new Random().Next(360), false, false);
            NetworkSetVoiceChannel(999);
            MenuList.ShowLobbyMenu();

            Freeze(true);
            Invisible(true);
            await UI.HideLoadDisplay();
        }
        public static async void SwitchToShop()
        {
            await UI.ShowLoadDisplay();

            Sync.Data.Reset(-1, "StartTimer");
            Respawn(new Vector3(406.2783f, -749.1988f, 28.3256f), new Random().Next(360), false, false);
            NetworkSetVoiceChannel(999);
            MenuList.ShowShopMenu();

            Freeze(true);
            Invisible(true);
            await UI.HideLoadDisplay();
        }
        public static async void SwitchToMainMenu()
        {
            await UI.ShowLoadDisplay();

            var rand = new Random();
            int i    = rand.Next(SpawnList.Length / 3);

            Respawn(new Vector3((float)SpawnList[i, 0], (float)SpawnList[i, 1], (float)SpawnList[i, 2] + 50), rand.Next(360), false, false);

            NetworkSetVoiceChannel(999);
            MenuList.ShowMainMenu();

            Freeze(true);
            Invisible(true);
            await UI.HideLoadDisplay();
        }
        public static void SetStatusType(int status)
        {
            StopSpec();
            MenuList.HideMenu();

            _statusType = status;
            SetRichPresence(GetStatusTypeLabel());
            Sync.Data.Set(GetServerId(), "StatusType", _statusType);

            switch (_statusType)
            {
            case 0:
                SwitchToMainMenu();
                break;

            case 1:
                SwitchToShop();
                break;

            case 2:
                SwitchToLobby();
                break;

            case 3:
                SwitchToGame();
                break;

            case 4:
                SwitchToSpec();
                break;

            case 5:
                SwitchToBriefing();
                break;
            }

            ResetValues();
        }
 public static void SwitchToGame()
 {
     SetEntityHealth(GetPlayerPed(-1), 200);
     Notification.Send("~g~GO! GO! GO!");
     MenuList.HideMenu();
 }