diff --git a/src/Commands/Player/Give.gml b/src/Commands/Player/Give.gml new file mode 100644 index 0000000..d9ac101 --- /dev/null +++ b/src/Commands/Player/Give.gml @@ -0,0 +1,20 @@ +#define GiveItemCommand + CommandCreate("giveItem", 0, ScriptWrap(GiveItem), "item_ID", "quantity"); + +#define GiveItem(_args) +/// @desc Gives said item to the player + + if (!InGame()) return Trace(global.notInGameMessage) + + var _item, _quantity; + + // Assign values + _item = real(_args[0]); + _quantity = real(_args[1]); + + // Give Item + GainItem(_item, _quantity); + + // Message + Trace("Received " + string(_quantity) + " " + string(ItemGet(_item, ItemData.Name))); + \ No newline at end of file diff --git a/src/Main.gml b/src/Main.gml new file mode 100644 index 0000000..5e465b7 --- /dev/null +++ b/src/Main.gml @@ -0,0 +1,8 @@ +#define Main + +// Global +globalMessages() + +// Player +GiveItemCommand() + diff --git a/src/Util/Util.gml b/src/Util/Util.gml new file mode 100644 index 0000000..0e4ea44 --- /dev/null +++ b/src/Util/Util.gml @@ -0,0 +1,8 @@ +#define globalMessages + global.notInGameMessage = "You can only use this command when in-game!"; + global.invalidArgCountMessage = "Invalid number of arguments!"; + global.invalidArg = "Invalid argument!"; + +#define InGame + return room != rmMainMenu; + \ No newline at end of file diff --git a/src/fmConfig.json b/src/fmConfig.json new file mode 100644 index 0000000..0e72029 --- /dev/null +++ b/src/fmConfig.json @@ -0,0 +1,6 @@ +{ + "name": "Cheater", + "author": "76561198068082688", + "targetAPIVersion": "1.0.0", + "dependencies": [] +} \ No newline at end of file