Exemplo n.º 1
0
        public override void Use(Player p, string message, CommandData data)
        {
            if (p.Game.PledgeSurvive)
            {
                p.Message("You cannot un-pledge that you will be infected."); return;
            }
            if (ZSGame.IsInfected(p))
            {
                p.Message("You cannot use &T/human &Sas you are currently infected."); return;
            }

            if (Economy.Enabled && p.money < 5)
            {
                p.Message("You need to have at least 5 &3" + Server.Config.Currency +
                          " &Sto pledge that you will not be infected."); return;
            }
            if (!ZSGame.Instance.RoundInProgress)
            {
                p.Message("Can only use &T/human &Swhen a round is in progress."); return;
            }

            TimeSpan delta = ZSGame.Instance.RoundEnd - DateTime.UtcNow;

            if (delta < TimeSpan.FromMinutes(3))
            {
                p.Message("Cannot use &T/human &Sin last three minutes of a round."); return;
            }

            p.Game.PledgeSurvive = true;
            ZSGame.Instance.Map
            .Message(p.ColoredName + " &Spledges that they will not succumb to the infection!");
        }
Exemplo n.º 2
0
        public override void Use(Player p, string message, CommandData data)
        {
            Player who = message.Length == 0 ? p : PlayerInfo.FindMatches(p, message);

            if (who == null)
            {
                return;
            }

            if (!ZSGame.Instance.RoundInProgress || ZSGame.IsInfected(who))
            {
                p.Message("Cannot infect player");
            }
            else if (!who.Game.Referee)
            {
                ZSGame.Instance.InfectPlayer(who, p);
                Chat.MessageFrom(who, "λNICK &Swas infected.");
            }
        }