Example #1
0
        /// <summary>
        /// Changes a players rank
        /// </summary>
        /// <param name="p">The player object to change</param>
        /// <param name="g">The rank to change the player to</param>
        public static void ChangeRank(Player p, GroupEnum g)
        {
            bool blnResendMap = ((p.checkOp() && g <= GroupEnum.Moderator) || (!p.checkOp() && g >= GroupEnum.Moderator));

            p.group = Group.Find(g);
            p.ClearActions();
            ChangeRank(p.name, g);

            if (blnResendMap)
            {
                p.ChangeLevel(p.level);
            }
            else
            {
                GlobalDie(p, false);
                GlobalRespawn(p);
            }
        }