コード例 #1
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);
        }
コード例 #2
0
ファイル: Group.cs プロジェクト: netzbasis/MCGalaxy
        static void UpdateGroup(Player p)
        {
            Group grp = Group.Find(p.group.Permission);

            if (grp == null)
            {
                grp = DefaultRank;
            }
            p.group = grp;

            p.UpdateColor(PlayerInfo.DefaultColor(p));
        }