// Auto-generated command skeleton class // Use this as a basis for custom MCGalaxy commands // Naming should be kept consistent (e.g. /update command should have a class name of 'CmdUpdate' and a filename of 'CmdUpdate.cs') // As a note, MCGalaxy is designed for .NET 4.0 // To reference other assemblies, put a "//reference [assembly filename]" at the top of the file // e.g. to reference the System.Data assembly, put "//reference System.Data.dll" // Add any other using statements you need after this using System; using MCGalaxy; using MCGalaxy.Modules.Awards; public class CmdGiveinsane : Command { // The command's name (what you put after a slash to use this command) public override string name { get { return "Giveinsane"; } } // Command's shortcut, can be left blank (e.g. "/Copy" has a shortcut of "c") public override string shortcut { get { return ""; } } // Which submenu this command displays in under /Help public override string type { get { return "Other"; } } // Whether or not this command can be used in a museum. Block/map altering commands should return false to avoid errors. public override bool museumUsable { get { return false; } } // The default rank required to use this command. Valid values are: // LevelPermission.Guest, LevelPermission.Builder, LevelPermission.AdvBuilder, // LevelPermission.Operator, LevelPermission.Admin, LevelPermission.Owner public override LevelPermission defaultRank { get { return LevelPermission.Guest; } } // This is for when a player executes this command by doing /Giveinsane // p is the player object for the player executing the command. // message is the arguments given to the command. (e.g. for '/Giveinsane this', message is "this") public override void Use(Player p, string message) { const string myAward = "Insane"; bool hasAwardAlready = PlayerAwards.Get(p.name).CaselessContains(myAward); if (hasAwardAlready) { p.Message("You have already claimed this award!"); return; // When we write return, that will quit running the command so that the code below doesn't run } //Give the player the award if they haven't already gotten it Command.Find("award").Use(Player.Console, "give "+p.name+" "+myAward); } // This is for when a player does /Help Giveinsane public override void Help(Player p) { p.Message("/Giveinsane - Does nothing."); } }