• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Some basic functions.

EvulMastah

๏̯͡๏﴿
Premium User
Joined
Aug 19, 2007
Messages
4,941
Solutions
11
Reaction score
352
Function:
Code:
function doAddContainerWithItems(cid, bp, item, type, amount)
	container = doPlayerAddItem(cid, bp, 1)
	for i = 1,amount do
		doAddContainerItem(container, item, type)
	end
end
Example: doAddContainerWithItems(cid, 2002, 2273, 3, 20) -- BP UH with 3 charges.

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
Example: doAddContainerWithItemsInContainer(cid, 2003, 2003, 2268, 3, 20, 20) 20 Backpacks fullfilled with SDS(x3) in 1 BP

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
Example:
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:
Hehe thanks for posting:p
The bp with items is very usefull I think. most of the people don't know how to do it.
 
Back
Top