Ejemplo n.º 1
0
 public override void Use(Player p, string message)
 {
     if (message != "")
     {
         Player target = Player.Find(message);
         if (target != null)
         {
             if (!target.hidden)
             {
                 if (p.level != target.level)
                 {
                     target.ChangeLevel(p.level.name);
                 }
                 unchecked
                 {
                     target.SendPos((byte)-1, p.pos[0], p.pos[1], p.pos[2], p.rot[0], 0);
                 }
                 target.SendMessage("You were summoned by " + p.color + p.name + "&e.");
             }
             else
             {
                 p.SendMessage("There is no player \"" + message + "\"!");
             }
         }
         else
         {
             p.SendMessage("There is no player \"" + message + "\"!");
         }
     }
     else
     {
         Help(p);
     }
 }
Ejemplo n.º 2
0
        // Code to run when used by a player
        public override void Use(Player p,string message)
        {
            bool blnLevelFound = false;
            Level targetLevel = null;
            if (message != "")
            {
                message = message.ToLower();
                if (p.level.name.ToLower() != message)
                {
                    foreach (Level level in Server.levels)
                    {
                        if (level.name.ToLower() == message)
                        {
                            targetLevel = level;
                            blnLevelFound = true;
                            break;
                        }
                    }
                    if (blnLevelFound)
                    {
                        if (targetLevel.PlayerCanVisit(p))
                        {
                            p.ChangeLevel(targetLevel);
                            if (!p.hidden)
                            {
                                Player.GlobalChat(p, p.color + "*" + p.name + "&e went to \"" + p.level.name + "\".", false);
                            }
                        }
                        else
                        {
                            p.SendMessage("You do not have perimssion to visit this level");
                        }
                    }
                    else
                    {
                        // Level either not found or non-existant

                        p.SendMessage("There is no level \"" + message + "\" loaded.");
                    }

                }
                else
                {
                    p.SendMessage("You are already on that level!");
                }
            }
            else
            {
                Help(p);
            }
        }
Ejemplo n.º 3
0
        // Code to run when used by a player
        public override void Use(Player p, string message)
        {
            bool blnLevelFound = false;
            Map  targetLevel   = null;

            if (message != "")
            {
                message = message.ToLower();
                if (p.level.name.ToLower() != message)
                {
                    foreach (Map level in Server.levels)
                    {
                        if (level.name.ToLower() == message)
                        {
                            targetLevel   = level;
                            blnLevelFound = true;
                            break;
                        }
                    }
                    if (blnLevelFound)
                    {
                        if (targetLevel.PlayerCanVisit(p))
                        {
                            p.ChangeLevel(targetLevel);
                            if (!p.hidden)
                            {
                                Player.GlobalChat(p, p.color + "*" + p.name + "&e went to \"" + p.level.name + "\".", false);
                            }
                        }
                        else
                        {
                            p.SendMessage("You do not have perimssion to visit this level");
                        }
                    }
                    else
                    {
                        // Map either not found or non-existant

                        p.SendMessage("There is no level \"" + message + "\" loaded.");
                    }
                }
                else
                {
                    p.SendMessage("You are already on that level!");
                }
            }
            else
            {
                Help(p);
            }
        }
Ejemplo n.º 4
0
        // Code to run when used by a player
        public override void Use(Player p, string message)
        {
            if (message != "")
            {
                if (Player.ValidName(message))
                {
                    Player target = Player.Find(message);
                    if (target != null)
                    {
                        // if the target is visible or your rank is higher than theirs, then teleport
                        if (!target.hidden || p.Rank > target.Rank)
                        {
                            if (p.level != target.level)
                            {
                                // Change levels if needed
                                p.ChangeLevel(target.level.name);
                            }
                            // Teleport to the player
                            unchecked
                            {
                                p.SendPos((byte)-1, target.pos[0], target.pos[1], target.pos[2], target.rot[0], 0);
                            }
                        }
                        else
                        {
                            // Player is offline
                            p.SendMessage("There is no player \"" + message + "\"!");
                        }
                    }
                    else
                    {
                        // Player is offline
                        p.SendMessage("There is no player \"" + message + "\"!");
                    }

                }
                else
                {
                    p.SendMessage("Invalid Name!");
                }
            }
            else
            {
                Help(p);
            }
        }
Ejemplo n.º 5
0
 // Code to run when used by a player
 public override void Use(Player p, string message)
 {
     if (message != "")
     {
         if (Player.ValidName(message))
         {
             Player target = Player.Find(message);
             if (target != null)
             {
                 // if the target is visible or your rank is higher than theirs, then teleport
                 if (!target.hidden || p.Rank > target.Rank)
                 {
                     if (p.level != target.level)
                     {
                         // Change levels if needed
                         p.ChangeLevel(target.level.name);
                     }
                     // Teleport to the player
                     unchecked
                     {
                         p.SendPos((byte)-1, target.pos[0], target.pos[1], target.pos[2], target.rot[0], 0);
                     }
                 }
                 else
                 {
                     // Player is offline
                     p.SendMessage("There is no player \"" + message + "\"!");
                 }
             }
             else
             {
                 // Player is offline
                 p.SendMessage("There is no player \"" + message + "\"!");
             }
         }
         else
         {
             p.SendMessage("Invalid Name!");
         }
     }
     else
     {
         Help(p);
     }
 }
Ejemplo n.º 6
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);
            }
        }