sn3ejk
This account is inactive.
- Joined
- Nov 16, 2011
- Messages
- 2,121
- Solutions
- 1
- Reaction score
- 145
function
doPlayerAddDepotItems(cid, items, town)
____________________________________
doPlayerAddDepotItems(cid, items, town)
____________________________________
Lua:function doPlayerAddDepotItems(cid, items, town) if (not isPlayer(cid)) then error("Player not found") end local town = town or getPlayerTown(cid) local parcel = doCreateItemEx(ITEM_PARCEL) for item, count in pairs(items) do if (type(item) == "number") then doAddContainerItem(parcel, item, count) elseif (type(item) == "string") then doAddContainerItem(parcel, getItemIdByName(item), count) else error("Undefinied type of item name") end end return doPlayerSendMailByName(getCreatureName(cid), parcel, town) end
Lua:-- example usage doPlayerAddDepotItems(cid, {[2160] = 60, ["backpack"] = 1}) doPlayerAddDepotItems(cid, {["gold coin"] = 100, ["crystal coin"] = 16})