Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function doPlayerAddItemStacking(cid, itemid, quant)
- local item = getItemsInContainerById(getPlayerSlotItem(cid, 3).uid, itemid)
- local piles = 0
- if #item > 0 then
- for i,x in pairs(item) do
- if getThing(x).type < 100 then
- local it = getThing(x)
- doTransformItem(it.uid, itemid, it.type+quant)
- if it.type+quant > 100 then
- doPlayerAddItem(cid, itemid, it.type+quant-100)
- end
- else
- piles = piles+1
- end
- break
- end
- else
- return doPlayerAddItem(cid, itemid, quant)
- end
- if piles == #item then
- doPlayerAddItem(cid, itemid, quant)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement