本文整理汇总了C#中MCForge.Player.SendPos方法的典型用法代码示例。如果您正苦于以下问题:C# Player.SendPos方法的具体用法?C# Player.SendPos怎么用?C# Player.SendPos使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MCForge.Player
的用法示例。
在下文中一共展示了Player.SendPos方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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.depth));
ushort zz = (ushort)(rand.Next(0, mainlevel.height));
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.depth));
zz = (ushort)(rand.Next(0, mainlevel.height));
}
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]); }
}
示例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; }
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 (!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 Player.SendMessage(p, "The level " + message + " is locked.");
}
}
else if (Server.AutoLoad)
{
if (!File.Exists("levels/" + message + ".lvl"))
Player.SendMessage(p, "Level \"" + message + "\" doesn't exist!");
else if (Level.Find(message) != null || Level.CheckLoadOnGoto(message))
{
Command.all.Find("load").Use(p, message);
foundLevel = Level.Find(message);
if (foundLevel != null) Use(p, message);
}
else
Player.SendMessage(p, "Level \"" + message + "\" cannot be loaded using /goto!");
}
else Player.SendMessage(p, "There is no level \"" + message + "\" loaded.");
GC.Collect();
GC.WaitForPendingFinalizers();
}
catch (Exception e) { Server.ErrorLog(e); }
}
示例4: Use
//.........这里部分代码省略.........
}
}
else if (p.group.Permission >= LevelPermission.Operator)
{
if (par0 == "download")
{
try
{
using (WebClient WEB = new WebClient())
{
WEB.DownloadFile("http://db.tt/R0x1MFS", "levels/countdown.lvl");
Player.SendMessage(p, "Downloaded map, now loading map and sending you to it.");
}
}
catch
{
Player.SendMessage(p, "Sorry, Downloading Failed. PLease try again later");
return;
}
Command.all.Find("load").Use(p, "countdown");
Command.all.Find("goto").Use(p, "countdown");
Thread.Sleep(1000);
// Sleep for a bit while they load
while (p.Loading) { Thread.Sleep(250); }
p.level.permissionbuild = LevelPermission.Nobody;
p.level.motd = "Welcome to the Countdown map!!!! -hax";
ushort x = System.Convert.ToUInt16(8);
ushort y = System.Convert.ToUInt16(23);
ushort z = System.Convert.ToUInt16(17);
x *= 32; x += 16;
y *= 32; y += 32;
z *= 32; z += 16;
unchecked { p.SendPos((byte)-1, x, y, z, p.rot[0], p.rot[1]); }
}
else if (par0 == "enable")
{
if (CountdownGame.gamestatus == CountdownGameStatus.Disabled)
{
try
{
Command.all.Find("load").Use(null, "countdown");
CountdownGame.mapon = Level.Find("countdown");
CountdownGame.gamestatus = CountdownGameStatus.Enabled;
Player.GlobalMessage("Countdown has been enabled!!");
}
catch
{
Player.SendMessage(p, "Failed, have you downloaded the map yet??");
}
}
else
{
Player.SendMessage(p, "A Game is either already enabled or is already progress");
return;
}
}
else if (par0 == "disable")
{
if (CountdownGame.gamestatus == CountdownGameStatus.AboutToStart || CountdownGame.gamestatus == CountdownGameStatus.InProgress)
{
Player.SendMessage(p, "Sorry, a game is currently in progress - please wait till its finished or use '/countdown cancel' to cancel the game");
return;
示例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: 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); }
}
}
}
示例7: 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) == true)
{
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;
}
}
}
示例8: 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();
}
示例9: 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");
}
}
示例10: 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);
}
}
示例11: 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); }
}
}
}
示例12: 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);
}
}
示例13: 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); }
}
}
示例14: Goto
public static void Goto(string waypoint, Player p)
{
if (!Exists(waypoint, p)) return;
WP 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; }
}
示例15: 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 (Server.infection)
{
CmdZombieGame.infect.Add(p);
CmdZombieGame.players.Remove(p);
p.color = c.red;
Player.GlobalDie(p, false);
Player.GlobalSpawn(p, p.pos[0], p.pos[1], p.pos[2], p.rot[0], p.rot[1], false);
}
}
unchecked
{
p.SendPos((byte)-1, x, y, z,
p.level.rotx,
p.level.roty);
}
}