Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. function doPlayerAddItemStacking(cid, itemid, quant)
  2. local item = getItemsInContainerById(getPlayerSlotItem(cid, 3).uid, itemid)
  3. local piles = 0
  4. if #item > 0 then
  5. for i,x in pairs(item) do
  6. if getThing(x).type < 100 then
  7. local it = getThing(x)
  8. doTransformItem(it.uid, itemid, it.type+quant)
  9. if it.type+quant > 100 then
  10. doPlayerAddItem(cid, itemid, it.type+quant-100)
  11. end
  12. else
  13. piles = piles+1
  14. end
  15. break
  16. end
  17. else
  18. return doPlayerAddItem(cid, itemid, quant)
  19. end
  20. if piles == #item then
  21. doPlayerAddItem(cid, itemid, quant)
  22. end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement