예제 #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
        internal static void DoHide(Player p, string message, bool messageOps)
        {
            if (message == "check")
            {
                string state = p.hidden ? "" : "not ";
                Player.SendMessage(p, "You are " + state + "currently hidden!"); return;
            }
            if (message != "" && p.possess != "")
            {
                Player.SendMessage(p, "Stop your current possession first."); return;
            }
            Command opchat    = Command.all.Find("opchat");
            Command adminchat = Command.all.Find("adminchat");

            p.hidden = !p.hidden;

            //Possible to use /hide myrank, but it accomplishes the same as regular /hide if you use it on yourself.
            if (message.ToLower() == "myrank")
            {
                p.otherRankHidden = !p.otherRankHidden;
                p.hidden          = p.otherRankHidden;
            }

            if (p.hidden)
            {
                Entities.GlobalDespawn(p, true);
                if (messageOps && !p.otherRankHidden)
                {
                    Chat.GlobalMessageOps("To Ops -" + p.color + p.DisplayName + "%S- is now &finvisible%S.");
                }
                string discMsg = PlayerDB.GetLogoutMessage(p);
                Player.SendChatFrom(p, "&c- " + p.FullName + " %S" + discMsg, false);
                Server.IRC.Say(p.DisplayName + " left the game (" + discMsg + ")");
                if (messageOps && !p.opchat)
                {
                    opchat.Use(p, message);
                }
            }
            else
            {
                Entities.GlobalSpawn(p, false);
                p.hidden          = false;
                p.otherRankHidden = false;
                if (messageOps)
                {
                    Chat.GlobalMessageAdmins("To Admins -" + p.color + p.DisplayName + "%S- is now &fvisible%S.");
                }

                Player.SendChatFrom(p, "&a+ " + p.FullName + " %S" + PlayerDB.GetLoginMessage(p), false);
                Server.IRC.Say(p.DisplayName + " joined the game");
                if (messageOps && p.opchat)
                {
                    opchat.Use(p, message);
                }
                if (p.adminchat)
                {
                    adminchat.Use(p, message);
                }
            }
        }
예제 #3
0
        internal static void DoHide(Player p, string message, bool messageOps)
        {
            if (message == "check")
            {
                string state = p.hidden ? "" : "not ";
                Player.SendMessage(p, "You are " + state + "currently hidden!"); return;
            }
            if (message != "" && p.possess != "")
            {
                Player.SendMessage(p, "Stop your current possession first."); return;
            }
            Command opchat    = Command.all.Find("opchat");
            Command adminchat = Command.all.Find("adminchat");

            p.hidden = !p.hidden;

            if (p.hidden)
            {
                Player.GlobalDespawn(p, true);
                if (messageOps)
                {
                    Chat.GlobalMessageOps("To Ops -" + p.color + p.DisplayName + "%S- is now &finvisible%S.");
                }

                string discMsg = PlayerDB.GetLogoutMessage(p);
                Player.SendChatFrom(p, "&c- " + p.FullName + " %S" + discMsg, false);
                Server.IRC.Say(p.DisplayName + " left the game (" + discMsg + ")");
                if (messageOps && !p.opchat)
                {
                    opchat.Use(p, message);
                }
            }
            else
            {
                Player.GlobalSpawn(p, false);
                if (messageOps)
                {
                    Chat.GlobalMessageOps("To Ops -" + p.color + p.DisplayName + "%S- is now &8visible%S.");
                }

                Player.SendChatFrom(p, "&a+ " + p.FullName + " %S" + PlayerDB.GetLoginMessage(p), false);
                Server.IRC.Say(p.DisplayName + " joined the game");
                if (messageOps && p.opchat)
                {
                    opchat.Use(p, message);
                }
                if (p.adminchat)
                {
                    adminchat.Use(p, message);
                }
            }
        }
예제 #4
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);
        }
예제 #5
0
        protected override void OnBuyCommand(Player p, string message, string[] args)
        {
            if (args.Length == 1)
            {
                Command.all.Find("logoutmessage").Use(null, p.name + " Disconnected.");
                Player.SendMessage(p, "%aYour logout message was removed for free.");
                return;
            }

            string text = message.Split(trimChars, 2)[1]; // keep spaces this way

            if (text == PlayerDB.GetLogoutMessage(p))
            {
                Player.SendMessage(p, "%cYou already have that logout message."); return;
            }
            if (text.Length > 64)
            {
                Player.SendMessage(p, "%cLogin message must be 64 characters or less."); return;
            }
            Command.all.Find("logoutmessage").Use(null, p.name + " " + text);
            Player.SendMessage(p, "%aYour logout message was changed to: %f" + text);
            MakePurchase(p, Price, "%3LogoutMessage: %f" + text);
        }
예제 #6
0
        protected override void DoPurchase(Player p, string message, string[] args)
        {
            if (args.Length == 1)
            {
                Command.all.FindByName("LogoutMessage").Use(null, p.name);
                Player.Message(p, "%aYour logout message was removed for free.");
                return;
            }

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

            if (text == PlayerDB.GetLogoutMessage(p))
            {
                Player.Message(p, "%cYou already have that logout message."); return;
            }
            if (text.Length > NetUtils.StringSize)
            {
                Player.Message(p, "%cLogin message must be 64 characters or less."); return;
            }
            Command.all.FindByName("LogoutMessage").Use(null, p.name + " " + text);
            Player.Message(p, "%aYour logout message was changed to: %f" + text);
            Economy.MakePurchase(p, Price, "%3LogoutMessage: %f" + text);
        }
예제 #7
0
 public PlayerProperties(Player player)
 {
     this.p = player;
     inMsg  = PlayerDB.GetLoginMessage(player);
     outMsg = PlayerDB.GetLogoutMessage(player);
 }
예제 #8
0
        public override void Use(Player p, string message, CommandData data)
        {
            if (message.Length > 0 && p.possess.Length > 0)
            {
                p.Message("Stop your current possession first."); return;
            }
            bool silent = false;

            if (message.CaselessEq("silent"))
            {
                if (!CheckExtraPerm(p, data, 1))
                {
                    return;
                }
                silent = true;
            }

            Command adminchat = Command.Find("AdminChat");
            Command opchat    = Command.Find("OpChat");

            Entities.GlobalDespawn(p, false);

            p.hidden = !p.hidden;
            if (p.hidden)
            {
                p.hideRank = data.Rank;
                AnnounceOps(p, "To Ops -λNICK%S- is now &finvisible");

                if (!silent)
                {
                    string leaveM = "&c- λFULL %S" + PlayerDB.GetLogoutMessage(p);
                    Chat.MessageFrom(p, leaveM, null, true);
                }

                if (!p.opchat)
                {
                    opchat.Use(p, "", data);
                }
                Server.hidden.AddUnique(p.name);
            }
            else
            {
                AnnounceOps(p, "To Ops -λNICK%S- is now &fvisible");
                p.hideRank = LevelPermission.Banned;

                if (!silent)
                {
                    string joinM = "&a+ λFULL %S" + PlayerDB.GetLoginMessage(p);
                    Chat.MessageFrom(p, joinM, null, true);
                }

                if (p.opchat)
                {
                    opchat.Use(p, "", data);
                }
                if (p.adminchat)
                {
                    adminchat.Use(p, "", data);
                }
                Server.hidden.Remove(p.name);
            }

            Entities.GlobalSpawn(p, false);
            TabList.Add(p, p, Entities.SelfID);
            Server.hidden.Save(false);
        }
예제 #9
0
        public override void Use(Player p, string message)
        {
            if (message.Length > 0 && p.possess.Length > 0)
            {
                Player.Message(p, "Stop your current possession first."); return;
            }
            bool announceToOps = true;

            if (message.CaselessEq("silent"))
            {
                if (!CheckExtraPerm(p, 1))
                {
                    return;
                }
                announceToOps = false;
            }

            Command adminchat = Command.all.FindByName("AdminChat");
            Command opchat    = Command.all.FindByName("OpChat");

            Entities.GlobalDespawn(p, false);

            p.hidden = !p.hidden;
            //Possible to use /hide myrank, but it accomplishes the same as regular /hide if you use it on yourself.
            if (message.CaselessEq("myrank"))
            {
                p.otherRankHidden = !p.otherRankHidden;
                p.hidden          = p.otherRankHidden;
            }

            if (p.hidden)
            {
                if (announceToOps && !p.otherRankHidden)
                {
                    Chat.MessageOps("To Ops -" + p.ColoredName + "%S- is now &finvisible%S.");
                }

                string discMsg = PlayerDB.GetLogoutMessage(p);
                Chat.MessageGlobal(p, "&c- " + p.FullName + " %S" + discMsg, false);
                Server.IRC.Say(p.DisplayName + " %Sleft the game (disconnected%S)");
                if (announceToOps && !p.opchat)
                {
                    opchat.Use(p, "");
                }
                Server.hidden.AddIfNotExists(p.name);
            }
            else
            {
                p.otherRankHidden = false;
                p.oHideRank       = LevelPermission.Null;
                if (announceToOps)
                {
                    Chat.MessageOps("To Ops -" + p.ColoredName + "%S- is now &fvisible%S.");
                }

                Chat.MessageGlobal(p, "&a+ " + p.FullName + " %S" + PlayerDB.GetLoginMessage(p), false);
                Server.IRC.Say(p.DisplayName + " %Sjoined the game");
                if (p.opchat)
                {
                    opchat.Use(p, "");
                }
                if (p.adminchat)
                {
                    adminchat.Use(p, "");
                }
                Server.hidden.Remove(p.name);
            }

            Entities.GlobalSpawn(p, false);
            TabList.Add(p, p, Entities.SelfID);
            Server.hidden.Save(false);
        }
예제 #10
0
        public override void Use(Player p, string message)
        {
            if (Player.IsSuper(p))
            {
                MessageInGameOnly(p); return;
            }
            if (message == "check")
            {
                string state = p.hidden ? "" : "not ";
                Player.Message(p, "You are " + state + "currently hidden!"); return;
            }
            if (message != "" && p.possess != "")
            {
                Player.Message(p, "Stop your current possession first."); return;
            }
            bool messageOps = true;

            if (message.CaselessEq("silent"))
            {
                if (!CheckExtraPerm(p))
                {
                    MessageNeedExtra(p, "hide silently"); return;
                }
                messageOps = false;
            }

            Command opchat    = Command.all.Find("opchat");
            Command adminchat = Command.all.Find("adminchat");

            p.hidden = !p.hidden;

            //Possible to use /hide myrank, but it accomplishes the same as regular /hide if you use it on yourself.
            if (message.CaselessEq("myrank"))
            {
                p.otherRankHidden = !p.otherRankHidden;
                p.hidden          = p.otherRankHidden;
            }

            if (p.hidden)
            {
                Entities.GlobalDespawn(p, false);
                if (messageOps && !p.otherRankHidden)
                {
                    Chat.MessageOps("To Ops -" + p.ColoredName + "%S- is now &finvisible%S.");
                }

                string discMsg = PlayerDB.GetLogoutMessage(p);
                Player.SendChatFrom(p, "&c- " + p.FullName + " %S" + discMsg, false);
                Server.IRC.Say(p.DisplayName + " %Sleft the game (" + discMsg + "%S)");
                if (messageOps && !p.opchat)
                {
                    opchat.Use(p, message);
                }
                Server.hidden.AddIfNotExists(p.name);
            }
            else
            {
                Entities.GlobalSpawn(p, false);
                p.otherRankHidden = false;
                p.oHideRank       = LevelPermission.Null;
                if (messageOps)
                {
                    Chat.MessageAdmins("To Admins -" + p.ColoredName + "%S- is now &fvisible%S.");
                }

                Player.SendChatFrom(p, "&a+ " + p.FullName + " %S" + PlayerDB.GetLoginMessage(p), false);
                Server.IRC.Say(p.DisplayName + " %Sjoined the game");
                if (messageOps && p.opchat)
                {
                    opchat.Use(p, message);
                }
                if (p.adminchat)
                {
                    adminchat.Use(p, message);
                }
                Server.hidden.Remove(p.name);
            }

            TabList.Add(p, p, Entities.SelfID);
            Server.hidden.Save(false);
        }