当前位置: 首页>>代码示例>>C#>>正文


C# Player.SendPos方法代码示例

本文整理汇总了C#中Player.SendPos方法的典型用法代码示例。如果您正苦于以下问题:C# Player.SendPos方法的具体用法?C# Player.SendPos怎么用?C# Player.SendPos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Player的用法示例。


在下文中一共展示了Player.SendPos方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Use

 public override void Use(Player p, string message)
 {
     if (message != "") { Help(p); return; }
     ushort x = (ushort)((0.5 + p.level.spawnx) * 32);
     ushort y = (ushort)((1 + p.level.spawny) * 32);
     ushort z = (ushort)((0.5 + p.level.spawnz) * 32);
     if (!p.referee)
     {
         if (!p.infected && Server.zombie.GameInProgess())
         {
             Server.zombie.InfectPlayer(p);
         }
     }
     if (p.PlayingTntWars)
     {
         TntWarsGame it = TntWarsGame.GetTntWarsGame(p);
         if (it.GameMode == TntWarsGame.TntWarsGameMode.TDM && it.GameStatus != TntWarsGame.TntWarsGameStatus.WaitingForPlayers && it.GameStatus != TntWarsGame.TntWarsGameStatus.Finished && it.RedSpawn != null && it.BlueSpawn != null)
         unchecked
         {
             p.SendPos((byte)-1,
                         (ushort)((0.5 + (it.FindPlayer(p).Blue ? it.BlueSpawn[0] : it.RedSpawn[0]) * 32)),
                         (ushort)((1 + (it.FindPlayer(p).Blue ? it.BlueSpawn[1] : it.RedSpawn[1]) * 32)),
                         (ushort)((0.5 + (it.FindPlayer(p).Blue ? it.BlueSpawn[2] : it.RedSpawn[2]) * 32)),
                         (byte)(it.FindPlayer(p).Blue ? it.BlueSpawn[3] : it.RedSpawn[3]),
                         (byte)(it.FindPlayer(p).Blue ? it.BlueSpawn[4] : it.RedSpawn[4]));
             return;
         }
     }
     unchecked
     {
         p.SendPos((byte)-1, x, y, z,
                     p.level.rotx,
                     p.level.roty);
     }
 }
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:35,代码来源:CmdSpawn.cs

示例2: Use

 public override void Use(Player p, string message)
 {
     ushort posy = (ushort)((p.pos[1] / 32) - 1);
     bool found = false;
     ushort xpos = (ushort)(p.pos[0] / 32);
     ushort zpos = (ushort)(p.pos[2] / 32);
     while (!found && posy > 0)
     {
         posy = (ushort)(posy - 1);
         byte block = p.level.GetTile(xpos, posy, zpos);
         if (block == Block.air || block == Block.air_door || block == Block.air_switch || block == Block.Zero)
         {
             ushort blockabove = (ushort)(posy + 1);
             ushort blockunder = (ushort)(posy - 1);
             if (p.level.GetTile(xpos, blockabove, zpos) == Block.air || p.level.GetTile(xpos, blockabove, zpos) == Block.air_door || p.level.GetTile(xpos, blockabove, zpos) == Block.air_switch || p.level.GetTile(xpos, blockabove, zpos) == Block.Zero)
             {
                 if (p.level.GetTile(xpos, blockunder, zpos) != Block.air && p.level.GetTile(xpos, blockunder, zpos) != Block.air_switch && p.level.GetTile(xpos, blockunder, zpos) != Block.air_door && p.level.GetTile(xpos, blockunder, zpos) != Block.air_flood && p.level.GetTile(xpos, blockunder, zpos) != Block.air_flood_down && p.level.GetTile(xpos, blockunder, zpos) != Block.air_flood_layer && p.level.GetTile(xpos, blockunder, zpos) != Block.air_flood_up && p.level.GetTile(xpos, blockunder, zpos) != Block.air_portal && p.level.GetTile(xpos, blockunder, zpos) != Block.redflower && p.level.GetTile(xpos, blockunder, zpos) != Block.yellowflower && p.level.GetTile(xpos, blockunder, zpos) != Block.finiteWater && p.level.GetTile(xpos, blockunder, zpos) != Block.finiteLava && p.level.GetTile(xpos, blockunder, zpos) != Block.fire && p.level.GetTile(xpos, blockunder, zpos) != Block.water && p.level.GetTile(xpos, blockunder, zpos) != Block.water_door && p.level.GetTile(xpos, blockunder, zpos) != Block.water_portal && p.level.GetTile(xpos, blockunder, zpos) != Block.WaterDown && p.level.GetTile(xpos, blockunder, zpos) != Block.WaterFaucet && p.level.GetTile(xpos, blockunder, zpos) != Block.lava && p.level.GetTile(xpos, blockunder, zpos) != Block.lava_door && p.level.GetTile(xpos, blockunder, zpos) != Block.lava_fast && p.level.GetTile(xpos, blockunder, zpos) != Block.lava_portal && p.level.GetTile(xpos, blockunder, zpos) != Block.LavaDown && p.level.GetTile(xpos, blockunder, zpos) != Block.lavastill && p.level.GetTile(xpos, blockunder, zpos) != Block.Zero)
                 {
                     Player.SendMessage(p, "Teleported you down!");
                     unchecked { p.SendPos((byte)-1, p.pos[0], (ushort)((posy + 1) * 32), p.pos[2], p.rot[0], p.rot[1]); }
                     found = true;
                 }
             }
         }
     }
     if (!found)
     {
         Player.SendMessage(p, "No free spaces found below you");
     }
 }
开发者ID:AnthonyANI,项目名称:MCForge-MCLawl,代码行数:30,代码来源:CmdDescend.cs

示例3: Use

 public override void Use(Player p, string message)
 {
     if (p.beforeTeleportMap == "")
     {
         p.SendMessage("You have not teleported anywhere yet");
         return;
     }
     if (p.level.name.ToLower() != p.beforeTeleportMap.ToLower())
         Command.all.Find("goto").Use(p, p.beforeTeleportMap);
     unchecked { p.SendPos((byte)-1, p.beforeTeleportPos[0], p.beforeTeleportPos[1], p.beforeTeleportPos[2], 0, 0); }
 }
开发者ID:Fire200055,项目名称:MCGalaxy,代码行数:11,代码来源:CmdBack.cs

示例4: Use

        public override void Use(Player p, string message) {
            bool showInfected = p.aka;
            p.aka = !p.aka;
            ushort x = p.pos[0], y = p.pos[1], z = p.pos[2];

            p.Loading = true;
            foreach (Player pl in Player.players)
                if (p.level == pl.level && p != pl) p.SendDie(pl.id);
            foreach (PlayerBot b in PlayerBot.playerbots)
                if (p.level == b.level) p.SendDie(b.id);

            Player.GlobalDie(p, true);
            p.SendUserMOTD();
            p.SendMap();

            if (!p.hidden) {
                Player.GlobalDie(p, false);
                Player.GlobalSpawn(p, x, y, z, p.level.rotx, p.level.roty, true);
            } else {
                p.SendPos(0xFF, x, y, z, p.level.rotx, p.level.roty);
            }
            
            foreach (Player pl in Player.players) {
                if (pl.level != p.level || p == pl || pl.hidden ||pl.referee)
                    continue;
                
                string name = null;
                if (pl.infected && showInfected) {
                    name = Server.ZombieName != "" ? c.red + Server.ZombieName : c.red + pl.name;
                } else {
                    name = pl.color + pl.name;
                }
                p.SendSpawn(pl.id, name,
                            pl.pos[0], pl.pos[1], pl.pos[2], pl.rot[0], pl.rot[1]);
            }
            
            foreach (PlayerBot b in PlayerBot.playerbots)
                if (b.level == p.level)
                    p.SendSpawn(b.id, b.color + b.name, b.pos[0], b.pos[1], b.pos[2], b.rot[0], b.rot[1]);

            p.Loading = false;
            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:44,代码来源:CmdAka.cs

示例5: Use


//.........这里部分代码省略.........
                        else { Warp.AddWarp(par1, Player.Find(par2)); }
                    }
                    {
                        if (Warp.WarpExists(par1))
                        {
                            Player.SendMessage(p, "Warp created!");
                            return;
                        }
                        else
                        {
                            Player.SendMessage(p, "Warp creation failed!!");
                            return;
                        }
                    }
                }
                else { Player.SendMessage(p, "You can't use that because you aren't a" + Group.findPermInt(CommandOtherPerms.GetPerm(this, 1)).name + "+"); return; }
            }

            if (par0 == "delete" || par0 == "remove" || par0 == "d" || par0 == "r")
            {
                if ((int)p.group.Permission >= CommandOtherPerms.GetPerm(this, 2))
                {
                    if (par1 == null) { Player.SendMessage(p, "You didn't specify a warp to delete!"); return; }
                    if (!Warp.WarpExists(par1)) { Player.SendMessage(p, "Warp doesn't exist!!"); return; }
                    {
                        Warp.DeleteWarp(par1);
                    }
                    {
                        if (!Warp.WarpExists(par1))
                        {
                            Player.SendMessage(p, "Warp deleted!");
                            return;
                        }
                        else
                        {
                            Player.SendMessage(p, "Warp deletion failed!!");
                            return;
                        }
                    }
                }
                else { Player.SendMessage(p, "You can't use that because you aren't a" + Group.findPermInt(CommandOtherPerms.GetPerm(this, 2)).name + "+"); return; }
            }

            if (par0 == "move" || par0 == "change" || par0 == "edit" || par0 == "m" || par0 == "e")
            {
                if ((int)p.group.Permission >= CommandOtherPerms.GetPerm(this, 3))
                {
                    if (par1 == null) { Player.SendMessage(p, "You didn't specify a warp to be moved!"); return; }
                    if (!Warp.WarpExists(par1)) { Player.SendMessage(p, "Warp doesn't exist!!"); return; }
                    {
                        if (par2 == null) { Warp.MoveWarp(par1, p); }
                        else { Warp.MoveWarp(par1, Player.Find(par2)); }
                    }
                    {
                        if (Warp.WarpExists(par1))
                        {
                            Player.SendMessage(p, "Warp moved!");
                            return;
                        }
                        else
                        {
                            Player.SendMessage(p, "Warp moving failed!!");
                            return;
                        }
                    }
                }
                else { Player.SendMessage(p, "You can't use that because you aren't a " + Group.findPermInt(CommandOtherPerms.GetPerm(this, 3)).name + "+"); return; }
            }

            else
            {
                if (Warp.WarpExists(par0))
                {
                    Warp.Wrp w = new Warp.Wrp();
                    w = Warp.GetWarp(par0);
                    Level lvl = Level.Find(w.lvlname);
                    if (lvl != null)
                    {
                        if (p.level != lvl)
                        {
                            if (lvl.permissionvisit > p.group.Permission) { Player.SendMessage(p, "Sorry, you aren't a high enough rank to visit the map that that warp is on."); return; }
                            Command.all.Find("goto").Use(p, lvl.name);
                            while (p.Loading) { Thread.Sleep(250); }
                        }
                        unchecked { p.SendPos((byte)-1, w.x, w.y, w.z, w.rotx, w.roty); }
                        return;
                    }
                    else
                    {
                        Player.SendMessage(p, "The level that that warp is on (" + w.lvlname + ") either no longer exists or is currently unloaded");
                        return;
                    }
                }
                else
                {
                    Player.SendMessage(p, "That is not a command addition or a warp");
                    return;
                }
            }
        }
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:101,代码来源:CmdWarp.cs

示例6: Use

        public override void Use(Player p, string message)
        {
            if (message == "") message = "list";

            string[] parameters = message.Split(' ');

            if (parameters[0].ToLower() == "list")
            {
                if (parameters.Length > 1)
                {
                    int pageNum, currentNum;
                    try
                    {
                        pageNum = int.Parse(parameters[1]) * 10; currentNum = pageNum - 10;
                    }
                    catch { Help(p); return; }

                    if (currentNum < 0) { Player.SendMessage(p, "Must be greater than 0"); return; }
                    if (pageNum > p.level.ZoneList.Count) pageNum = p.level.ZoneList.Count;
                    if (currentNum > p.level.ZoneList.Count) { Player.SendMessage(p, "No Zones beyond number " + (p.level.ZoneList.Count - 1)); return; }

                    Player.SendMessage(p, "Zones (" + currentNum + " to " + (pageNum - 1) + "):");
                    for (int i = currentNum; i < pageNum; i++)
                    {
                        Level.Zone zone = p.level.ZoneList[i];
                        Player.SendMessage(p, "&c" + i + " &b(" +
                            zone.smallX + "-" + zone.bigX + ", " +
                            zone.smallY + "-" + zone.bigY + ", " +
                            zone.smallZ + "-" + zone.bigZ + ") &f" +
                            zone.Owner);
                    }
                }
                else
                {
                    for (int i = 0; i < p.level.ZoneList.Count; i++)
                    {
                        Level.Zone zone = p.level.ZoneList[i];
                        Player.SendMessage(p, "&c" + i + " &b(" +
                            zone.smallX + "-" + zone.bigX + ", " +
                            zone.smallY + "-" + zone.bigY + ", " +
                            zone.smallZ + "-" + zone.bigZ + ") &f" +
                            zone.Owner);
                    }
                    Player.SendMessage(p, "For a more structured list, use /tpzone list <1/2/3/..>");
                }
            }
            else
            {
                int zoneID;
                try
                {
                    zoneID = int.Parse(message);
                }
                catch { Help(p); return; }

                if (zoneID < 0 || zoneID > p.level.ZoneList.Count)
                {
                    Player.SendMessage(p, "This zone doesn't exist");
                    return;
                }

                Level.Zone zone = p.level.ZoneList[zoneID];
                unchecked { p.SendPos((byte)-1, (ushort)(zone.bigX * 32 + 16), (ushort)(zone.bigY * 32 + 32), (ushort)(zone.bigZ * 32 + 16), p.rot[0], p.rot[1]); }

                Player.SendMessage(p, "Teleported to zone &c" + zoneID + " &b(" +
                    zone.bigX + ", " + zone.bigY + ", " + zone.bigZ + ") &f" +
                    zone.Owner);
            }
        }
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:69,代码来源:CmdTpZone.cs

示例7: Blockchange1


//.........这里部分代码省略.........
                ushort startZ = (ushort)(p.pos[2] / 32);

                pos.x = (ushort)Math.Round(startX + (double)(a * 3));
                pos.y = (ushort)Math.Round(startY + (double)(c * 3));
                pos.z = (ushort)Math.Round(startZ + (double)(b * 3));

                for (double t = 4; bigDiag > t; t++)
                {
                    pos.x = (ushort)Math.Round(startX + (double)(a * t));
                    pos.y = (ushort)Math.Round(startY + (double)(c * t));
                    pos.z = (ushort)Math.Round(startZ + (double)(b * t));

                    by = p.level.GetTile(pos.x, pos.y, pos.z);

                    if (by != Block.air && !allBlocks.Contains(pos))
                    {
                        if (p.level.physics < 2 || bp.ending <= 0)
                        {
                            break;
                        }
                        else
                        {
                            if (bp.ending == 1)
                            {
                                if ((!Block.LavaKill(by) && !Block.NeedRestart(by)) && by != Block.glass)
                                {
                                    break;
                                }
                            }
                            else if (p.level.physics >= 3)
                            {
                                if (by != Block.glass)
                                {
                                    if (p.allowTnt == true)
                                    {
                                        p.level.MakeExplosion(pos.x, pos.y, pos.z, 1);
                                        break;
                                    }
                                }
                            }
                            else
                            {
                                break;
                            }
                        }
                    }

                    p.level.Blockchange(pos.x, pos.y, pos.z, type);
                    previous.Add(pos);
                    allBlocks.Add(pos);

                    bool comeOut = false;
                    foreach (Player pl in Player.players)
                    {
                        if (pl.level == p.level)
                        {
                            if ((ushort)(pl.pos[0] / 32) == pos.x || (ushort)(pl.pos[0] / 32  + 1) == pos.x || (ushort)(pl.pos[0] / 32 - 1) == pos.x)
                            {
                                if ((ushort)(pl.pos[1] / 32) == pos.y || (ushort)(pl.pos[1] / 32 + 1) == pos.y || (ushort)(pl.pos[1] / 32 - 1) == pos.y)
                                {
                                    if ((ushort)(pl.pos[2] / 32) == pos.z || (ushort)(pl.pos[2] / 32 + 1) == pos.z || (ushort)(pl.pos[2] / 32 - 1) == pos.z)
                                    {
                                        if (p.level.physics >= 3 && bp.ending >= 2)
                                            pl.HandleDeath(Block.stone, " was blown up by " + p.color + p.name, true);
                                        else
                                            pl.HandleDeath(Block.stone, " was shot by " + p.color + p.name);
                                        comeOut = true;

                                    }
                                }
                            }
                        }
                    }
                    if (comeOut) break;

                    if (t > 12 && bp.ending != 3)
                    {
                        pos = previous[0];
                        p.level.Blockchange(pos.x, pos.y, pos.z, Block.air);
                        previous.Remove(pos);
                    }

                    if (bp.ending != 3) Thread.Sleep(20);
                }

                if (bp.ending == -1)
                    try
                    {
                        unchecked { p.SendPos((byte)-1, (ushort)(previous[previous.Count - 3].x * 32), (ushort)(previous[previous.Count - 3].y * 32 + 32), (ushort)(previous[previous.Count - 3].z * 32), p.rot[0], p.rot[1]); }
                    } catch { }
                if (bp.ending == 3) Thread.Sleep(400);

                foreach (CatchPos pos1 in previous)
                {
                    p.level.Blockchange(pos1.x, pos1.y, pos1.z, Block.air);
                    if (bp.ending != 3) Thread.Sleep(20);
                }
            }));
            gunThread.Start();
        }
开发者ID:hirsty,项目名称:MCForge-Vanilla,代码行数:101,代码来源:CmdGun.cs

示例8: Use

        public override void Use(Player p, string message)
        {
            p.onTrain = !p.onTrain;

            if (!p.onTrain) return;

            Thread trainThread = new Thread(new ThreadStart(delegate
            {
                while (p.onTrain)
                {
                    Thread.Sleep(3);

                    ushort x = (ushort)(p.pos[0] / 32);
                    ushort y = (ushort)(p.pos[1] / 32);
                    ushort z = (ushort)(p.pos[2] / 32);

                    for (ushort xx = (ushort)(x - 1); xx <= x + 1; xx++)
                    {
                        for (ushort yy = (ushort)(y - 1); yy <= y + 1; yy++)
                        {
                            for (ushort zz = (ushort)(z - 1); zz <= z + 1; zz++)
                            {
                                if (p.level.GetTile(xx, yy, zz) == Block.train)
                                {
                                    p.invincible = true; p.trainGrab = true;
                                    byte newY = 0;

                                    if (y - yy == -1) newY = 240;
                                    else if (y - yy == 0) newY = 0;
                                    else newY = 8;

                                    unchecked
                                    {
                                        if (x - xx == -1)
                                            if (z - zz == -1) p.SendPos((byte)-1, (ushort)(xx * 32 + 16), (ushort)((yy + 1) * 32 - 2), (ushort)(zz * 32 + 16), (byte)96, newY);
                                            else if (z - zz == 0) p.SendPos((byte)-1, (ushort)(xx * 32 + 16), (ushort)((yy + 1) * 32 - 2), (ushort)(zz * 32 + 16), (byte)64, newY);
                                            else p.SendPos((byte)-1, (ushort)(xx * 32 + 16), (ushort)((yy + 1) * 32 - 2), (ushort)(zz * 32 + 16), (byte)32, newY);
                                        else if (x - xx == 0)
                                            if (z - zz == -1) p.SendPos((byte)-1, (ushort)(xx * 32 + 16), (ushort)((yy + 1) * 32 - 2), (ushort)(zz * 32 + 16), (byte)128, newY);
                                            else if (z - zz == 0) { }
                                            else p.SendPos((byte)-1, (ushort)(xx * 32 + 16), (ushort)((yy + 1) * 32 - 2), (ushort)(zz * 32 + 16), (byte)0, newY);
                                        else
                                            if (z - zz == -1) p.SendPos((byte)-1, (ushort)(xx * 32 + 16), (ushort)((yy + 1) * 32 - 2), (ushort)(zz * 32 + 16), (byte)160, newY);
                                            else if (z - zz == 0) p.SendPos((byte)-1, (ushort)(xx * 32 + 16), (ushort)((yy + 1) * 32 - 2), (ushort)(zz * 32 + 16), (byte)192, newY);
                                            else p.SendPos((byte)-1, (ushort)(xx * 32 + 16), (ushort)((yy + 1) * 32 - 2), (ushort)(zz * 32 + 16), (byte)224, newY);
                                    }
                                    goto skip;
                                }
                            }
                        }
                    }

                    Thread.Sleep(3);
                    p.invincible = false;
                    p.trainGrab = false;
            skip:   ;                 
                }

                Player.SendMessage(p, "Dismounted");
                Thread.Sleep(1000);
                p.invincible = false;
                p.trainGrab = false;
            }));
            trainThread.Name = "MCG_RideTrain";
            trainThread.Start();
            Player.SendMessage(p, "Stand near a train to mount it");
        }
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:67,代码来源:CmdRide.cs

示例9: Goto

 public static void Goto(string waypoint, Player p)
 {
     if (Exists(waypoint, p))
     {
         WP wp = Find(waypoint, p);
         if (wp != null)
         {
             if (p.level != wp.level)
             {
                 Command.all.Find("goto").Use(p, wp.level.name);
                 while (p.Loading) { Thread.Sleep(250); }
             }
             unchecked { p.SendPos((byte)-1, wp.x, wp.y, wp.z, wp.rotx, wp.roty); }
         }
     }
 }
开发者ID:Herocane,项目名称:MCForge-Vanilla,代码行数:16,代码来源:Player.cs

示例10: Blockchange2

        public void Blockchange2(Player p, ushort x, ushort y, ushort z, byte Type)
        {
            ppos.x = p.pos[0];
            ppos.y = p.pos[1];
            ppos.z = p.pos[2];
            pllvl = p.level.name;
            blox[1].x = x;
            blox[1].y = y;
            blox[1].z = z;// jetz direction rausfinden und dann unten verwenden.
            int direction; //1 = 0,0,0 nach 1,0,0  2= 0,0,0 nach 0,1,0  3= 1,0,0 nach 0 und 4 = 010 nach 0
            if (blox[1].x > blox[0].x)
            {
                direction = 1;
                p.SendMessage("dir1");
            }
            else if (blox[1].x < blox[0].x)
            {
                direction = 3;
                p.SendMessage("dir3");
            }
            else if (blox[1].z > blox[0].z)
            {
                direction = 2;
                p.SendMessage("dir2");
            }
            else if (blox[1].z < blox[0].z)
            {
                direction = 4;
                p.SendMessage("dir4");
            }
            else
            {
                direction = 1;
                p.SendMessage("else");
            }

            String cinName = "";
            cinName = msg;
            using (Stream imageStreamSource = new FileStream("extra/images/" + msg + ".gif", FileMode.Open, FileAccess.Read, FileShare.Read))
            {
                GifBitmapDecoder decoder = new GifBitmapDecoder(imageStreamSource, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
                for (int i = 0; i < decoder.Frames.Count; i++)
                {
                    //saving all frames as pngs.
                    BitmapSource bitmapSource = decoder.Frames[i];
                    using (FileStream fs = new FileStream("extra/images/" + i.ToString() + ".bmp", FileMode.Create))
                    {
                        BmpBitmapEncoder encoder = new BmpBitmapEncoder();
                        encoder.Frames.Add(BitmapFrame.Create(bitmapSource));
                        encoder.Save(fs);
                    }
                }
                using (System.Drawing.Bitmap tbmp = new System.Drawing.Bitmap("extra/images/0.bmp"))
                {
                    picHeight = tbmp.Height;
                    picWidth = tbmp.Width;
                    //create the new map...
                    Command.all.Find("newlvl").Use(p, "gtctempmap " + picWidth.ToString() + " " + picHeight.ToString() + " " + picWidth.ToString() + " space");
                    Command.all.Find("load").Use(p, "gtctempmap");
                    //moving the player to this map
                    Command.all.Find("move").Use(p, p.name + " gtctempmap");
                    System.Threading.Thread.Sleep(2000);
                    for (int i = 0; i < decoder.Frames.Count; i++)
                    {
                        p.SendMessage("Start processing Frame " + i);
                        workFrame(i, p, cinName, direction);
                        p.SendMessage("Done");
                    }
                    p.SendMessage("YAY! everything should be done");
                    Command.all.Find("move").Use(p, p.name + " " + pllvl);
                    unchecked { p.SendPos((byte)-1, ppos.x, ppos.y, ppos.z, 0, 0); }
                    Command.all.Find("deletelvl").Use(p, "gtctempmap");//deleting templvl
                    for (int i = 0; i < decoder.Frames.Count; i++)
                    {
                        File.Delete("extra/images/" + i.ToString() + ".bmp");
                    }
                }
            }
        }
开发者ID:Balthizar01,项目名称:MCForge-Vanilla-Redux,代码行数:79,代码来源:CmdGifToCin.cs

示例11: Use

        public override void Use(Player p, string message)
        {
            if (p == null) { Player.SendMessage(p, "This command can only be used in-game!"); return; }
            if (message == "") { Help(p); return; }

            try
            {
                Level foundLevel = Level.Find(message);
                if (foundLevel != null)
                {
                    Level startLevel = p.level;

                    GC.Collect();

                    if (p.level == foundLevel) { Player.SendMessage(p, "You are already in \"" + foundLevel.name + "\"."); return; }
                    if (!p.ignorePermission)
                        if (p.group.Permission < foundLevel.permissionvisit) { Player.SendMessage(p, "You're not allowed to go to " + foundLevel.name + "."); return; }
                    if (!p.ignorePermission)
                        if (p.group.Permission > foundLevel.pervisitmax) { if (!p.group.CanExecute(Command.all.Find("pervisitmax"))) { Player.SendMessage(p, "Your rank must be " + foundLevel.pervisitmax + " or lower to go there!"); return; } }
                    {
                        if (!File.Exists("text/lockdown/map/" + message + ""))
                        {

                            p.Loading = true;
                            foreach (Player pl in Player.players) if (p.level == pl.level && p != pl) p.SendDie(pl.id);
                            foreach (PlayerBot b in PlayerBot.playerbots) if (p.level == b.level) p.SendDie(b.id);

                            Player.GlobalDie(p, true);
                            p.level = foundLevel; p.SendUserMOTD(); p.SendMap();

                            GC.Collect();

                            ushort x = (ushort)((0.5 + foundLevel.spawnx) * 32);
                            ushort y = (ushort)((1 + foundLevel.spawny) * 32);
                            ushort z = (ushort)((0.5 + foundLevel.spawnz) * 32);

                       //     if (Server.pctf.CTFStatus() != 0 && message == Server.pctf.currentLevelName)
                         //       unchecked { Server.pctf.sendToTeamSpawn(p); }
                           // else
                            //{
                            //    Server.pctf.PlayerDC(p);
                                if (!p.hidden) Player.GlobalSpawn(p, x, y, z, foundLevel.rotx, foundLevel.roty, true, "");
                                else unchecked { p.SendPos((byte)-1, x, y, z, foundLevel.rotx, foundLevel.roty); }
                            }

                            //if (!p.hidden) Player.GlobalSpawn(p, x, y, z, foundLevel.rotx, foundLevel.roty, true, "");
                            //else unchecked { p.SendPos((byte)-1, x, y, z, foundLevel.rotx, foundLevel.roty); }

                            foreach (Player pl in Player.players)
                                if (pl.level == p.level && p != pl && !pl.hidden)
                                    p.SendSpawn(pl.id, pl.color + pl.name, pl.pos[0], pl.pos[1], pl.pos[2], pl.rot[0], pl.rot[1], pl.DisplayName, pl.SkinName);

                            foreach (PlayerBot b in PlayerBot.playerbots)
                                if (b.level == p.level)
                                    p.SendSpawn(b.id, b.color + b.name, b.pos[0], b.pos[1], b.pos[2], b.rot[0], b.rot[1], b.DisplayName, b.SkinName);

                            if (!p.hidden) Player.GlobalChat(p, p.color + "*" + p.name + Server.DefaultColor + " went to &b" + foundLevel.name, false);

                            p.Loading = false;

                            bool skipUnload = false;
                            if (startLevel.unload && !startLevel.name.Contains("&cMuseum "))
                            {
                                foreach (Player pl in Player.players) if (pl.level == startLevel) { skipUnload = true; break; }
                                if (!skipUnload && Server.AutoLoad) startLevel.Unload(true);
                            }

                            if (Server.lava.active && !Server.lava.sendingPlayers && Server.lava.map == foundLevel)
                            {
                                if (Server.lava.roundActive)
                                {
                                    Server.lava.AnnounceRoundInfo(p);
                                    Server.lava.AnnounceTimeLeft(!Server.lava.flooded, true, p);
                                }
                                else
                                {
                                    Player.SendMessage(p, "Vote for the next map!");
                                    Player.SendMessage(p, "Choices: " + Server.lava.VoteString);
                                }
                            }

                            if (Server.zombie.GameInProgess())
                            {
                                if (p.level.name == Server.zombie.currentLevelName)
                                    Server.zombie.InfectedPlayerLogin(p);
                            }

                            if (p.level.name != Server.zombie.currentLevelName)
                            {
                                if(ZombieGame.alive.Contains(p))
                                ZombieGame.alive.Remove(p);
                                if (ZombieGame.infectd.Contains(p))
                                ZombieGame.infectd.Remove(p);
                            }
                            if (p.inTNTwarsMap)
                            {
                                p.canBuild = true;
                            }
                            if (TntWarsGame.Find(p.level) != null)
                            {
//.........这里部分代码省略.........
开发者ID:NorthPL,项目名称:MCForge-Vanilla-Redux,代码行数:101,代码来源:CmdGoto.cs

示例12: Use

        public override void Use(Player p, string message)
        {
            if (message == "")
            {
                Command.all.Find("spawn");
                return;
            }
            int number = message.Split(' ').Length;
            if (number > 2) { Help(p); return; }
            if (number == 2)
            {
                if (!p.group.CanExecute(Command.all.Find("P2P")))
                {
                   Player.SendMessage(p, "You cannot teleport others!");
                   return;
                }
                Command.all.Find("P2P").Use(p, message);
            }
            if (number == 1)
            {
                Player who = Player.Find(message);
                if (who == null || (who.hidden && p.group.Permission < LevelPermission.Admin)) { Player.SendMessage(p, "There is no player \"" + message + "\"!"); return; }
                if (p.level != who.level)
                {
                    if (who.level.name.Contains("cMuseum"))
                    {
                        Player.SendMessage(p, "Player \"" + message + "\" is in a museum!");
                        return;
                    }
                    else
                    {
                        if (Server.higherranktp == false)
                        {
                            if (p.group.Permission < who.group.Permission)
                            {
                                Player.SendMessage(p, "You cannot teleport to a player of higher rank!");
                                return;
                            }
                        }
                        Command.all.Find("goto").Use(p, who.level.name);
                    }
                }
                if (p.level == who.level)
                {
                    if (Server.higherranktp == false)
                    {
                        if (p.group.Permission < who.group.Permission)
                        {
                            Player.SendMessage(p, "You cannot teleport to a player of higher rank!");
                            return;
                        }
                    }

                    if (who.Loading)
                    {
                        Player.SendMessage(p, "Waiting for " + who.color + who.name + Server.DefaultColor + " to spawn...");
                        while (who.Loading) { }
                    }
                    while (p.Loading) { }  //Wait for player to spawn in new map
                    unchecked { p.SendPos((byte)-1, who.pos[0], who.pos[1], who.pos[2], who.rot[0], 0); }
                }
            }
        }
开发者ID:NorthPL,项目名称:MCForge-Vanilla-Redux,代码行数:63,代码来源:CmdTp.cs


注:本文中的Player.SendPos方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。