summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-08-25 19:42:04 +0300
committerAndrei Karas <akaras@inbox.ru>2016-08-25 19:50:18 +0300
commit1873a9bec687b0653a483f7bb46e513db5bc10f0 (patch)
treef348c1924eb7f5e6b444c05384e458628bc86224 /src/actions
parentfc52464414c7e77e77c3f08a089ad0ad5a350c71 (diff)
downloadplus-1873a9bec687b0653a483f7bb46e513db5bc10f0.tar.gz
plus-1873a9bec687b0653a483f7bb46e513db5bc10f0.tar.bz2
plus-1873a9bec687b0653a483f7bb46e513db5bc10f0.tar.xz
plus-1873a9bec687b0653a483f7bb46e513db5bc10f0.zip
Add chat command for create items. (gm only)
New chat command: /createitem id [, amount]
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/actions.cpp15
-rw-r--r--src/actions/actions.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp
index 94dd1765e..f855deb05 100644
--- a/src/actions/actions.cpp
+++ b/src/actions/actions.cpp
@@ -1492,6 +1492,21 @@ impHandler0(createItems)
return true;
}
+impHandler(createItem)
+{
+ int id = 0;
+ int amount = 0;
+
+ if (!adminHandler)
+ return false;
+
+ if (parse2Int(event.args, id, amount))
+ adminHandler->createItems(id, ItemColor_one, amount);
+ else
+ adminHandler->createItems(atoi(event.args.c_str()), ItemColor_one, 1);
+ return true;
+}
+
impHandler(uploadConfig)
{
// TRANSLATORS: upload config chat message
diff --git a/src/actions/actions.h b/src/actions/actions.h
index 034661282..fd145852d 100644
--- a/src/actions/actions.h
+++ b/src/actions/actions.h
@@ -95,6 +95,7 @@ namespace Actions
decHandler(testSdlFont);
#endif
decHandler(createItems);
+ decHandler(createItem);
decHandler(uploadConfig);
decHandler(uploadServerConfig);
decHandler(uploadLog);