本文整理汇总了C#中MCDeamon.Player.SendPos方法的典型用法代码示例。如果您正苦于以下问题:C# Player.SendPos方法的具体用法?C# Player.SendPos怎么用?C# Player.SendPos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MCDeamon.Player
的用法示例。
在下文中一共展示了Player.SendPos方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
unchecked
{
p.SendPos((byte)-1, x, y, z,
p.level.rotx,
p.level.roty);
}
}
示例2: Use
public override void Use(Player p, string message)
{
if (message == "")
{
Command.all.Find("spawn");
return;
}
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
{
Command.all.Find("goto").Use(p, who.level.name);
}
}
if (p.level == who.level)
{
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); }
}
}
示例3: Use
public override void Use(Player p, string message)
{
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; }
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 (!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]);
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]);
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;
if (!skipUnload && Server.AutoLoad) startLevel.Unload();
}
}
else if (Server.AutoLoad)
{
Command.all.Find("load").Use(p, message);
foundLevel = Level.Find(message);
if (foundLevel != null) Use(p, message);
}
else Player.SendMessage(p, "There is no level \"" + message + "\" loaded.");
GC.Collect();
GC.WaitForPendingFinalizers();
}
catch (Exception e) { Server.ErrorLog(e); }
}
示例4: 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);
}
}
示例5: 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.Start();
Player.SendMessage(p, "Stand near a train to mount it");
}
示例6: Blockchange1
//.........这里部分代码省略.........
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)
{
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.ctfmode && !p.level.ctfgame.friendlyfire && p.team == pl.team)
{
comeOut = true;
break;
}
if (p.level.ctfmode)
{
pl.health = pl.health - 25;
if (pl.health > 0)
{
pl.SendMessage("You have been shot! You have &c" + pl.health + Server.DefaultColor + " health remaining.");
comeOut = true;
break;
}
}
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();
}