Пример #1
0
        private Smod2.API.Team RollTeam()
        {
            IConfigFile config       = ConfigManager.Manager.Config;
            List <int>  respawnQueue = this.plugin.GetRespawnQueue();
            int         teamID;

            bool isUsingSmartPicker = config.GetBoolValue("smart_class_picker", false);

            if (isUsingSmartPicker)
            {
                // Smart picker is enabled
                // Using fake smart picker
                teamID = this.RollTeamSmart();
                return((Smod2.API.Team)teamID);
            }

            if (this.teamsSpawned.Count >= respawnQueue.Count)
            {
                // Overflow
                // Using filler picker
                teamID = this.RollTeamFiller();
                return((Smod2.API.Team)teamID);
            }

            // Picking next team from queue
            teamID = respawnQueue[this.teamsSpawned.Count];
            return((Smod2.API.Team)teamID);
        }
Пример #2
0
        public void OnDecontaminate()
        {
            if (cm.GetBoolValue("rank_enabled", true))
            {
                DBConnection db = new DBConnection(main);

                var alive = PluginManager.Manager.Server.GetPlayers().Where(palive => palive.TeamRole.Team != Smod2.API.Team.SPECTATOR);
                var dead  = PluginManager.Manager.Server.GetPlayers().Where(palive => palive.TeamRole.Team == Smod2.API.Team.SPECTATOR);

                foreach (Player p in alive)
                {
                    db.AddPoint(p.SteamId, main.GetConfigInt("rank_point_decont_alive"));
                }

                foreach (Player p in dead)
                {
                    db.AddPoint(p.SteamId, main.GetConfigInt("rank_point_decont_spec"));
                }
            }
        }
        private void PopulateEnabledSCPs()
        {
            string[] prefixes =
            {
                "scp049",
                "scp079",
                "scp096",
                "scp106",
                "scp173",
                "scp939_53",
                "scp939_89"
            };
            IConfigFile config = ConfigManager.Manager.Config;

            foreach (string prefix in prefixes)
            {
                bool isDisabled = config.GetBoolValue(prefix + "_disable", false);
                if (isDisabled)
                {
                    continue;
                }

                Role role = LaterJoin.ConvertSCPPrefixToRoleID(prefix);
                if (role == Role.UNASSIGNED)
                {
                    this.Error("Trying to convert unknown prefix: " + prefix);
                    continue;
                }

                int amount = config.GetIntValue(prefix + "_amount", 1);
                while (amount > 0)
                {
                    this.enabledSCPs.Add(role);
                    amount--;
                }
            }
        }
        public void CheckIfDisabled()
        {
            IConfigFile config = ConfigManager.Manager.Config;

            this.isDisabled = config.GetBoolValue("sf_lj_disable", false);
        }
Пример #5
0
 public void On079LevelUp(Player079LevelUpEvent ev)
 {
     if (cm.GetBoolValue("rank_enabled", true))
     {
         DBConnection db = new DBConnection(main);
         db.AddPoint(ev.Player.SteamId, main.GetConfigInt("rank_point_079_levelup"));
     }
 }