From b28da5bcd02be09de8d2be4d33db541403c32d8c Mon Sep 17 00:00:00 2001 From: xbang21 Date: Mon, 17 Mar 2014 20:40:15 -0400 Subject: [PATCH] fixed giveitem --- scripts/commands/giveitem.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 scripts/commands/giveitem.py diff --git a/scripts/commands/giveitem.py b/scripts/commands/giveitem.py new file mode 100644 index 00000000..8279dc05 --- /dev/null +++ b/scripts/commands/giveitem.py @@ -0,0 +1,24 @@ +import sys + +def setup(): + return + +def run(core, actor, target, commandString): + + if actor.getClient() and actor.getClient().isGM() == False: + return + + if not commandString.startswith('object/tangible') and not commandString.startswith('object/weapon'): + return + + object = core.objectService.createObject(commandString, actor.getPlanet()) + + if not object: + return + + inventory = actor.getSlottedObject('inventory') + + if inventory: + inventory.add(object) + + return \ No newline at end of file