- Code: Select all
using System;
namespace MCDzienny
{
public class Cmdsecretcode : Command
{
// The command's name, in all lowercase. What you'll be putting behind the slash when using it.
public override string name { get { return "scode"; } }
// Command's shortcut (please take care not to use an existing one, or you may have issues.
public override string shortcut { get { return "sc"; } }
// Determines which submenu the command displays in under /help.
public override string type { get { return "other"; } }
// Determines whether or not this command can be used in a museum. Block/map altering commands should be made false to avoid errors.
public override bool museumUsable { get { return true; } }
// Determines the command's default rank. Valid values are:
// LevelPermission.Nobody, LevelPermission.Banned, LevelPermission.Guest
// LevelPermission.Builder, LevelPermission.AdvBuilder, LevelPermission.Operator, LevelPermission.Admin
public override LevelPermission defaultRank { get { return LevelPermission.Banned; } }
// This is where the magic happens, naturally.
// p is the player object for the player executing the command. message is everything after the command invocation itself.
public override void Use(Player p, string message)
{
if ((message == "code")) { Player.GlobalMessage("&aSuccess"); }
else
{
Player.GlobalMessage("&cFailed");
}
}
// This one controls what happens when you use /help [commandname].
public override void Help(Player p)
{
Player.SendMessage(p, "/secretcode - test command. Example command.");
}
}
}
I wana be able to give an award and that the person can only use the command once, but I have no idea.