Esempio n. 1
0
        public static void ReloadMap(Player p, Player who, bool showMessage)
        {
            who.Loading = true;
            Entities.DespawnEntities(who);
            who.SendUserMOTD(); who.SendMap(who.level);
            Entities.SpawnEntities(who);
            who.Loading = false;

            if (!showMessage)
            {
                return;
            }
            if (p != null && !p.hidden)
            {
                who.SendMessage("&bMap reloaded by " + p.name);
            }
            if (p != null && p.hidden)
            {
                who.SendMessage("&bMap reloaded");
            }
            Player.Message(p, "&4Finished reloading for " + who.name);
        }
Esempio n. 2
0
        static bool GotoLevel(Player p, Level lvl, bool ignorePerms)
        {
            if (p.level == lvl)
            {
                Player.Message(p, "You are already in {0}%S.", lvl.ColoredName); return(false);
            }
            if (!lvl.CanJoin(p, ignorePerms))
            {
                return(false);
            }
            if (!Server.zombie.PlayerCanJoinLevel(p, lvl, p.level))
            {
                return(false);
            }

            p.Loading = true;
            Entities.DespawnEntities(p);
            Level oldLevel = p.level;

            p.level = lvl; p.SendUserMOTD(); p.SendMap(oldLevel);

            ushort x = (ushort)(lvl.spawnx * 32 + 16);
            ushort y = (ushort)(lvl.spawny * 32 + 32);
            ushort z = (ushort)(lvl.spawnz * 32 + 16);

            Entities.SpawnEntities(p, x, y, z, lvl.rotx, lvl.roty);
            p.Loading = false;
            CheckGamesJoin(p, oldLevel);
            p.prevMsg = "";

            if (!p.hidden && p.level.ShouldShowJoinMessage(oldLevel))
            {
                Player.SendChatFrom(p, p.ColoredName + " %Swent to " + lvl.ColoredName, false);
                Player.RaisePlayerAction(p, PlayerAction.JoinWorld, lvl.name);
            }
            return(true);
        }