Re: [Tutorial] How to add a custom command
Posted: 29 Jul 2011, 21:43
I will try to download that..
The first free minecraft classic server software that offers fully functional lava survival mode. Enjoy!
http://mcdzienny.cba.pl/
ZOMGxReferendum wrote:When i do this i get hello world. -_-
namespace MCDzienny
{
public class CmdHigh5 : Command
{
public override string name { get { return "high5"; } }
public override string shortcut { get { return ""; } }
public override string type { get { return "other"; } }
public override bool museumUsable { get { return false; } }
public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
public CmdHigh5() { }
public override void Use(Player p, string message)
{
if (message == "")
{
Help(p);
return;
}
Player player1 = Player.Find(message);
if (player1 == null || player1.hidden == true)
{
Player.SendMessage(p, "Could not find player specified.");
return;
}
string giver = (p == null) ? "The Console" : p.name;
string color = (p == null) ? "" : p.color;
Player.SendMessage(player1, giver + " just highfived you");
Player.GlobalMessage(color + giver + " " + Server.DefaultColor + "just highfived " + player1.color + player1.name);
}
// This one controls what happens when you use /help [commandname].
public override void Help(Player p)
{
Player.SendMessage(p, "/high5 <player> - High five someone :D");
}
}
}