本文整理汇总了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; }
}
示例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]); }
}