start of work moving commands to lua

This commit is contained in:
Tahir Akhlaq 2016-06-16 01:50:13 +01:00
parent 1159c75ab8
commit 57b9d5ab99
20 changed files with 703 additions and 67 deletions

View file

@ -0,0 +1,22 @@
require("global");
properties = {
permissions = 0,
parameters = "ssss",
description = "adds <item> <qty> to <location> for <target>. <qty> and <location> are optional, item is added to user if <target> is nil",
}
function onTrigger(player, argc, item, qty, location, target)
local sender = "[giveitem] ";
player = GetWorldManager():GetPCInWorld(target) or player;
if player then
item = tonumber(item) or nil;
qty = tonumber(qty) or 1;
location = tonumber(itemtype) or INVENTORY_NORMAL;
if item then
player:GetInventory(location):AddItem(item, qty);
player:SendMessage(MSG_TYPE_SYSTEM_ERROR, "[giveitem] ", string.format("Added item %u to %s", item, player:GetName());
end
end;
end;