[Requested] /pillar [Height] - makes a pillar with height
Posted: 20 May 2014, 08:57
This command was requested by Leeizazombie. Here ya go as requested. Enjoy!
- Code: Select all
//created by tommyz_
using System;
using System.Collections.Generic;
namespace MCDzienny
{
public class CmdPillar : Command
{
public override string name { get { return "pillar"; } }
public override string shortcut { get { return "pil"; } }
public override string type { get { return "build"; } }
public override bool museumUsable { get { return false; } }
public override LevelPermission defaultRank { get { return LevelPermission.AdvBuilder; } }
public CmdPillar() { }
public override void Use(Player p, string message)
{
if (message == "") { Help(p); return; }
int num = 0;
//test that message is a number
try { num = Convert.ToInt32(message); }
catch { Player.SendMessage(p, "Sorry you must only enter a number.");return; }
if (num > 128)
{ Player.SendMessage(p, "You may only enter a value that is between 1 and 128."); }
//get position of the player:
ushort x1 = 0; ushort y1 = 0; ushort z1 = 0;
x1 = (ushort)(p.pos[0] / 32);
y1 = (ushort)((p.pos[1] / 32) - 1);
z1 = (ushort)(p.pos[2] / 32);
//I didn't do cuboid here because in some situations you would be clicking off the map and
//it simply will not work that way
//and ahhh it kinda spams the chat, I wish this software had bool silent = false;
for (int i = 0; i <= num; i++)
{
Command.all.Find("line").Use(p, "stone"); //line
Command.all.Find("click").Use(p, (x1) + " " + (y1) + " " + (z1));
Command.all.Find("click").Use(p, (x1) + " " + (y1 + i) + " " + (z1));
}
Player.SendMessage(p, "&aPillar Completed!");
}
public override void Help(Player p)
{
Player.SendMessage(p, "/pillar [amount] - makes pillar [amount] high.");
}
}
}