Tprocheira
New Member
- Joined
- Apr 2, 2008
- Messages
- 103
- Reaction score
- 0
Hi there!
You know, sometimes you waste a LONG time buying potions (well, not that much now with that 'Buy with backpack' function), and have to arrange your money to buy the exact amount of potions?
Well, I've made this code, so that you can buy ANYTHING you want within a full backpack!!
And, that's it!
You just have to change the local variables to whatever you want.
First one is the price, second one is item to be added.
(Rep++ )
\\
You know, sometimes you waste a LONG time buying potions (well, not that much now with that 'Buy with backpack' function), and have to arrange your money to buy the exact amount of potions?
Well, I've made this code, so that you can buy ANYTHING you want within a full backpack!!
Code:
local price = [color=blue]3020[/color] --Backpack+Potions
local addItem = [color=red]7590[/color] --Great Mana Potion
--100% by Tprocheira
function onUse(cid, item, item2, fromPosition, toPosition)
if getPlayerMoney(cid) >= price then
doPlayerRemoveMoney(cid, price)
container = doPlayerAddItem(cid, 2000)
for i = 1, 20 do
doAddContainerItem(container, addItem)
end
else
doPlayerSendCancel(cid, "Sorry, you don't have enough money!")
end
end
You just have to change the local variables to whatever you want.
First one is the price, second one is item to be added.
(Rep++ )
\\