private void OnClientResourceStart(string resourceName)
        {
            if (GetCurrentResourceName() != resourceName)
            {
                return;
            }

            SetNuiFocus(false, false);

            ClientGlobals.Init();

            RegisterCommand("icm", new Action <int, List <object>, string>((source, args, raw) => {
                if (LocalPlayer.Name == "Salty Pigeon")
                {
                    TriggerServerEvent("salty:netStartGame", "icm");
                }
            }), false);

            RegisterCommand("ttt", new Action <int, List <object>, string>((source, args, raw) => {
                if (LocalPlayer.Name == "Salty Pigeon")
                {
                    TriggerServerEvent("salty:netStartGame", "ttt");
                }
            }), false);

            RegisterCommand("mvb", new Action <int, List <object>, string>((source, args, raw) => {
                if (LocalPlayer.Name == "Salty Pigeon")
                {
                    TriggerServerEvent("salty:netStartGame", "mvb");
                }
            }), false);

            RegisterCommand("noclip", new Action <int, List <object>, string>((source, args, raw) => {
                if (LocalPlayer.Name == "Salty Pigeon")
                {
                    ClientGlobals.SetNoClip(!ClientGlobals.isNoclip);
                }
            }), false);

            RegisterCommand("maps", new Action <int, List <object>, string>((source, args, raw) => {
                if (LocalPlayer.Name == "Salty Pigeon")
                {
                    TriggerServerEvent("salty:netOpenMapGUI");
                }
            }), false);

            RegisterCommand("kill", new Action <int, List <object>, string>((source, args, raw) => {
                LocalPlayer.Character.Kill();
            }), false);

            RegisterCommand("vote", new Action <int, List <object>, string>((source, args, raw) => {
                if (LocalPlayer.Name == "Salty Pigeon")
                {
                    TriggerServerEvent("salty:netBeginGameVote");
                }
            }), false);
        }
 public void EndGame()
 {
     if (ClientGlobals.CurrentGame != null)
     {
         ClientGlobals.CurrentGame.End();
         ClientGlobals.CurrentGame = null;
         ClientGlobals.SetSpectator(true);
         ClientGlobals.SetNoClip(true);
     }
 }
 private void PlayerSpawn(ExpandoObject spawnInfo)
 {
     if (BaseGamemode.Team == -1)
     {
         ClientGlobals.SetNoClip(true);
     }
     else if (ClientGlobals.CurrentGame != null)
     {
         ClientGlobals.CurrentGame.PlayerSpawn();
     }
     else
     {
         ClientGlobals.SetSpectator(true);
         ClientGlobals.SetNoClip(true);
     }
 }