Beispiel #1
0
        protected override void OnBuyCommand(Player p, string message, string[] args)
        {
            string text      = message.Split(trimChars, 2)[1]; // keep spaces this way
            bool   hasAToken = false;

            for (int i = 0; i < text.Length; i++)
            {
                if (!CheckEscape(text, i, ref hasAToken))
                {
                    Player.SendMessage(p, "You can only use {0} and {1} for tokens in infect messages."); return;
                }
            }
            if (!hasAToken)
            {
                Player.SendMessage(p, "You need to include a \"{0}\" (placeholder for zombie player) " +
                                   "and/or a \"{1}\" (placeholder for human player) in the infect message."); return;
            }

            PlayerDB.AppendInfectMessage(p.name, text);
            if (p.Game.InfectMessages == null)
            {
                p.Game.InfectMessages = new List <string>();
            }
            p.Game.InfectMessages.Add(text);
            Player.SendMessage(p, "%aAdded infect message: %f" + text);
            MakePurchase(p, Price, "%3InfectMessage: " + message);
        }