-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
47ce13d
commit c760533
Showing
4 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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))); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#define Main | ||
|
||
// Global | ||
globalMessages() | ||
|
||
// Player | ||
GiveItemCommand() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "Cheater", | ||
"author": "76561198068082688", | ||
"targetAPIVersion": "1.0.0", | ||
"dependencies": [] | ||
} |