- Joined
- Aug 19, 2007
- Messages
- 4,941
- Solutions
- 11
- Reaction score
- 352
Function:
Example: doAddContainerWithItems(cid, 2002, 2273, 3, 20) -- BP UH with 3 charges.
Function:
Example: doAddContainerWithItemsInContainer(cid, 2003, 2003, 2268, 3, 20, 20) 20 Backpacks fullfilled with SDS(x3) in 1 BP
Function:
Example:
Function:
Example: buy(cid, 2666, 3, 60) -- 3 hams(?) for 60 gp, will only work with stackables if charges > 1, else it will give just one item
I dont find them usefull, master-m.
Code:
function doAddContainerWithItems(cid, bp, item, type, amount)
container = doPlayerAddItem(cid, bp, 1)
for i = 1,amount do
doAddContainerItem(container, item, type)
end
end
Function:
Code:
function doAddContainerWithItemsInContainer(cid, bp_1, bp_2, item, type, amount_1, amount_2)
container_1 = doPlayerAddItem(cid, bp_1, 1)
for i = 1,amount_1 do
container_2 = doAddContainerItem(container_1, bp_2, 1)
for j = 1,amount_2 do
doAddContainerItem(container_2, item, type)
end
end
end
Function:
Code:
function buyContainer(cid, containerid, itemid, itemcount, price)
if doPlayerRemoveMoney(cid, price) == TRUE then
local container = doPlayerAddItem(cid, containerid, 1)
for i = 1, 20 do
doAddContainerItem(container, itemid, itemcount)
end
selfSay("Here you are.")
else
selfSay("Not enough money.")
end
end
Code:
if msgcontains(msg, 'backpack sd') then
buyContainer(cid, 1998, 2268, 3, 5000)
end
Function:
Code:
function buy(cid, itemid, charges, price)
if doPlayerRemoveMoney(cid, price) == TRUE then
doPlayerAddItem(cid, itemid, charges)
selfSay("Here you are.")
else
selfSay("Not enough money.")
end
end
Example: buy(cid, 2666, 3, 60) -- 3 hams(?) for 60 gp, will only work with stackables if charges > 1, else it will give just one item
I dont find them usefull, master-m.
Last edited: