Esempio n. 1
0
        public static void setteam(Arg arg)
        {
            BasePlayer basePlayer = ArgEx.Player(arg);

            if (basePlayer == null)
            {
                return;
            }
            BaseGameMode activeGameMode = BaseGameMode.GetActiveGameMode(true);

            if ((bool)activeGameMode)
            {
                int @int = arg.GetInt(0);
                if (@int >= 0 && @int < activeGameMode.GetNumTeams())
                {
                    activeGameMode.ResetPlayerScores(basePlayer);
                    activeGameMode.SetPlayerTeam(basePlayer, @int);
                    basePlayer.Respawn();
                }
            }
        }