예제 #1
0
        protected internal override void OnPurchase(Player p, string msg)
        {
            if (msg.Length == 0)
            {
                PlayerDB.SetLogoutMessage(p.name, "");
                p.Message("&aYour logout message was removed for free.");
                return;
            }

            if (!CheckPrice(p))
            {
                return;
            }
            if (msg == PlayerDB.GetLogoutMessage(p))
            {
                p.Message("&WYou already have that logout message."); return;
            }
            if (msg.Length > NetUtils.StringSize)
            {
                p.Message("&WLogin message must be 64 characters or less."); return;
            }

            UseCommand(p, "LogoutMessage", "-own " + msg);
            Economy.MakePurchase(p, Price, "%3LogoutMessage: %f" + msg);
        }
예제 #2
0
        public override void Use(Player p, string message)
        {
            if (message == "")
            {
                Help(p); return;
            }
            string[] args = message.Split(trimChars, 2);
            if (args.Length < 2)
            {
                Help(p); return;
            }

            Player target = PlayerInfo.Find(args[0]);
            string name   = target != null ? target.name : args[0];

            if (target == null && PlayerInfo.FindOfflineName(name) == null)
            {
                Player.SendMessage(p, "There is no player with the given name."); return;
            }
            PlayerDB.SetLogoutMessage(name, args[1]);

            string fullName = target != null ? target.ColoredName : name;

            Player.SendMessage(p, "The logout message of " + fullName + " %Shas been changed to: " + args[1]);
            string changer = p == null ? "(console)" : p.name;

            Server.s.Log(changer + " changed " + name + "'s logout message to:");
        }
예제 #3
0
 protected override void SetPlayerData(Player p, string target, string msg)
 {
     PlayerDB.SetLogoutMessage(target, msg);
     if (msg.Length == 0)
     {
         p.Message("Logout message of {0} %Swas removed.", p.FormatNick(target));
     }
     else
     {
         p.Message("Logout message of {0} %Swas changed to: {1}", p.FormatNick(target), msg);
     }
 }
예제 #4
0
 protected override void SetPlayerData(Player p, Player who, string msg)
 {
     PlayerDB.SetLogoutMessage(who.name, msg);
     if (msg.Length == 0)
     {
         p.Message("Logout message of {0} %Swas removed.",
                   who.ColoredName);
     }
     else
     {
         p.Message("Logout message of {0} %Swas changed to: {1}",
                   who.ColoredName, msg);
     }
 }
예제 #5
0
 protected override void SetPlayerData(Player p, Player who, string[] args)
 {
     if (args.Length == 1)
     {
         string path = PlayerDB.LogoutPath(who.name);
         if (File.Exists(path))
         {
             File.Delete(path);
         }
         Player.Message(p, "The logout message of {0} %Shas been removed.",
                        who.ColoredName);
     }
     else
     {
         PlayerDB.SetLogoutMessage(who.name, args[1]);
         Player.Message(p, "The logout message of {0} %Shas been changed to: {1}",
                        who.ColoredName, args[1]);
     }
 }
예제 #6
0
        protected override void DoPurchase(Player p, string message, string[] args)
        {
            if (args.Length == 1)
            {
                PlayerDB.SetLogoutMessage(p.name, "");
                p.Message("&aYour logout message was removed for free.");
                return;
            }

            string msg = message.SplitSpaces(2)[1]; // keep spaces this way

            if (msg == PlayerDB.GetLogoutMessage(p))
            {
                p.Message("%WYou already have that logout message."); return;
            }
            if (msg.Length > NetUtils.StringSize)
            {
                p.Message("%WLogin message must be 64 characters or less."); return;
            }

            UseCommand(p, "LogoutMessage", "-own " + msg);
            Economy.MakePurchase(p, Price, "%3LogoutMessage: %f" + msg);
        }