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


C# Player.SendPos方法代码示例

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


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

示例1: Goto

 public static void Goto(string waypoint, Player p) {
     if ( !Exists(waypoint, p) ) return;
     Waypoint wp = Find(waypoint, p);
     Level lvl = Level.Find(wp.lvlname);
     if ( wp == null ) return;
     if ( lvl != null ) {
         if ( p.level != lvl ) {
             Command.all.Find("goto").Use(p, lvl.name);
             while ( p.Loading ) { Thread.Sleep(250); }
         }
         unchecked { p.SendPos((byte)-1, wp.x, wp.y, wp.z, wp.rotx, wp.roty); }
         Player.SendMessage(p, "Sent you to waypoint");
     }
     else { Player.SendMessage(p, "The map that that waypoint is on isn't loaded right now (" + wp.lvlname + ")"); return; }
 }
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:15,代码来源:Waypoint.cs

示例2: SendToSpawn

        public void SendToSpawn(Level mainlevel, Auto_CTF game, Player p1)
        {
            Random rand = new Random();
            if (spawnx == 0 && spawny == 0 && spawnz == 0)
            {
                ushort xx = (ushort)(rand.Next(0, mainlevel.Width));
                ushort yy = (ushort)(rand.Next(0, mainlevel.Height));
                ushort zz = (ushort)(rand.Next(0, mainlevel.Length));
                while (mainlevel.GetTile(xx, yy, zz) != Block.air && game.OnSide((ushort)(zz * 32), this))
                {
                    xx = (ushort)(rand.Next(0, mainlevel.Width));
                    yy = (ushort)(rand.Next(0, mainlevel.Height));
                    zz = (ushort)(rand.Next(0, mainlevel.Length));
                }
                unchecked { p1.SendPos((byte)-1, (ushort)(xx * 32), (ushort)(yy * 32), (ushort)(zz * 32), p1.rot[0], p1.rot[1]); }
            }
            else
                unchecked { p1.SendPos((byte)-1, spawnx, spawny, spawnz, p1.rot[0], p1.rot[1]); }

        }
开发者ID:tommyz56,项目名称:MCGalaxy,代码行数:20,代码来源:Auto_CTF.cs


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