public override void Use(Player p, params string[] args) { if (args.Length < 4) { Help(p); return; } int width = 0; int length = 0; int height = 0; byte block = 2; try { width = Convert.ToInt32(args[0]); length = Convert.ToInt32(args[1]); height = Convert.ToInt32(args[2]); block = (byte)FindBlocks.FindBlock(args[3]); } catch { Help(p); return; } if (FindBlocks.FindBlock(args[3]) != -1) { Thread cuboid = new Thread(new ThreadStart(() => Cuboid(p, width, length, height, block))); cuboid.Start(); } else { p.SendMessage("block " + args[3] + " not found!"); } }
public override void Use(Player p, params string[] args) { SpheroidData cd; cd.x = 0; cd.y = 0; cd.z = 0; cd.type = -1; cd.vertical = false; if (args.Length >= 2) { try { cd.type = Convert.ToInt16(args[0]); } catch { cd.type = FindBlocks.FindBlock(args[0]); } if (!FindBlocks.ValidBlock(cd.type)) { p.SendMessage("There is no block \"" + args[0] + "\"."); return; } cd.vertical = (args[1].ToLower() == "vertical"); } else if (args.Length >= 1) { cd.vertical = (args[0].ToLower() == "vertical"); if (!cd.vertical) { try { cd.type = Convert.ToInt16(args[0]); } catch { cd.type = FindBlocks.FindBlock(args[0]); } if (!FindBlocks.ValidBlock(cd.type)) { p.SendMessage("There is no block \"" + args[0] + "\"."); return; } } } p.ClearBlockChange(); p.BlockChangeObject = cd; p.OnBlockChange += Blockchange1; p.SendMessage("Place/delete a block at 2 corners for the spheroid."); }
public override void Use(Player p, params string[] args) { CuboidData cd; cd.x = 0; cd.y = 0; cd.z = 0; cd.type = -1; cd.mode = CuboidType.Solid; if (args.Length >= 2) { try { cd.type = Convert.ToInt16(args[0]); } catch { cd.type = FindBlocks.FindBlock(args[0]); } if (!FindBlocks.ValidBlock(cd.type)) { p.SendMessage("There is no block \"" + args[0] + "\"."); return; } switch (args[1].ToLower()) { case "hollow": cd.mode = CuboidType.Hollow; break; case "walls": cd.mode = CuboidType.Walls; break; case "holes": cd.mode = CuboidType.Holes; break; case "wire": cd.mode = CuboidType.Wire; break; case "random": cd.mode = CuboidType.Random; break; } } else if (args.Length >= 1) { switch (args[0].ToLower()) { case "hollow": cd.mode = CuboidType.Hollow; break; case "walls": cd.mode = CuboidType.Walls; break; case "holes": cd.mode = CuboidType.Holes; break; case "wire": cd.mode = CuboidType.Wire; break; case "random": cd.mode = CuboidType.Random; break; } if (cd.mode == CuboidType.Solid) { try { cd.type = Convert.ToInt16(args[0]); } catch { cd.type = FindBlocks.FindBlock(args[0]); } if (!FindBlocks.ValidBlock(cd.type)) { p.SendMessage("There is no block \"" + args[0] + "\"."); return; } } } p.ClearBlockChange(); p.BlockChangeObject = cd; p.OnBlockChange += Blockchange1; p.SendMessage("Place/delete a block at 2 corners for the cuboid."); //p.Blockchange += new Player.BlockchangeEventHandler(Blockchange1); }