Esempio n. 1
0
        /// <summary> Attempts to change the title color of the target player </summary>
        public static bool SetTitleColor(Player p, string target, string name)
        {
            string color = "";
            Player who   = PlayerInfo.FindExact(target);

            if (name.Length == 0)
            {
                MessageAction(p, target, who, "λACTOR &Sremoved λTARGET title color");
            }
            else
            {
                color = Matcher.FindColor(p, name);
                if (color == null)
                {
                    return(false);
                }

                MessageAction(p, target, who, "λACTOR &Schanged λTARGET title color to " + color + Colors.Name(color));
            }

            if (who != null)
            {
                who.titlecolor = color;
            }
            if (who != null)
            {
                who.SetPrefix();
            }
            PlayerDB.Update(target, PlayerData.ColumnTColor, color);
            return(true);
        }
Esempio n. 2
0
        /// <summary> Attempts to change the color of the target player </summary>
        public static bool SetColor(Player p, string target, string name)
        {
            string color = "";
            Player who   = PlayerInfo.FindExact(target);

            if (name.Length == 0)
            {
                color = Group.GroupIn(target).Color;

                PlayerDB.Update(target, PlayerData.ColumnColor, "");
                MessageAction(p, target, who, "λACTOR &Sremoved λTARGET color");
            }
            else
            {
                color = Matcher.FindColor(p, name);
                if (color == null)
                {
                    return(false);
                }

                PlayerDB.Update(target, PlayerData.ColumnColor, color);
                MessageAction(p, target, who, "λACTOR &Schanged λTARGET color to " + color + Colors.Name(color));
            }
            if (who != null)
            {
                who.UpdateColor(color);
            }
            return(true);
        }
Esempio n. 3
0
        /// <summary> Attempts to change the title of the target player </summary>
        /// <remarks> Not allowed when players who cannot speak (e.g. muted) </remarks>
        public static bool SetTitle(Player p, string target, string title)
        {
            if (title.Length >= 20)
            {
                p.Message("&WTitle must be under 20 characters.");
                return(false);
            }
            Player who = PlayerInfo.FindExact(target);

            if (title.Length == 0)
            {
                MessageAction(p, target, who, "λACTOR &Sremoved λTARGET title");
            }
            else
            {
                if (!p.CheckCanSpeak("change titles"))
                {
                    return(false);
                }

                MessageAction(p, target, who, "λACTOR &Schanged λTARGET title to &b[" + title + "&b]");
            }

            if (who != null)
            {
                who.title = title;
            }
            if (who != null)
            {
                who.SetPrefix();
            }
            PlayerDB.Update(target, PlayerData.ColumnTitle, title.UnicodeToCp437());
            return(true);
        }