예제 #1
0
        public override void Use(Player p, params string[] args)
        {
            if (args.Length != 1) { Help(p); return; }

            World w = World.Find(args[0]);
            if (w == null) { p.SendMessage("Could not find specified level"); return; }
            if (p.level.name == w.name) { p.SendMessage("Already in " + p.level.name); return; }

            Player.players.ForEach(p1 => { if (p1.level == p.level) { p1.SendDespawn(p.id); p.SendDespawn(p1.id); } }); //dont want to be seen on 2 maps at once do we?
            //p.VisibleChunks.ForEach(pt => p.SendPreChunk(pt.x, pt.z, 0));  //apparently not needed since respawn packet is used.
            p.VisibleChunks.Clear();

            p.SaveLoc(); //when we go back to that level we end up at the same place.
            p.level = w;
            p.SendRespawn(); //loading screen and map settings information changes.
            p.pos = p.Saved_Pos();
            p.UpdateChunks(true, true);
            p.Teleport_Saved_Pos(); //send to saved position
            return;
        }