• 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!

bug when taking rewards...

nystrom

New Member
Joined
Nov 17, 2009
Messages
269
Reaction score
0
hello i have just made a quest that you get multiplied items from in the same chest.
and i use this script:
PHP:
function onUse(cid, item, frompos, item2, topos)

	if item.uid == 50016 then
		if getPlayerStorageValue(cid,40003) == -1 then
			doPlayerSendTextMessage(cid,25,"You have found a bag.")
			local bag = doPlayerAddItem(cid,1987,1)
			doAddContainerItem(bag,2432,1)
			doAddContainerItem(bag,2492,1)
			doAddContainerItem(bag,2516,1)
			doAddContainerItem(bag,2160,4)
			setPlayerStorageValue(cid,40003,1)
		else
			doPlayerSendTextMessage(cid,25,"The is empty.")
           end	
	end
	return TRUE
end

The thing that buggs is that if i dont have the right cap (i have to low cap) so will i just resive some of the items in the bag. not all of them.
So i wounder is it posible to add some kind of cap checker? or something that can help my players avoide this sort of losts :(
 
Try it, this is simple but i do not tested it:
Change how many OZ he must have... (there is 500 now)

LUA:
function onUse(cid, item, frompos, item2, topos) 

    if item.uid == 50016 then 
        if getPlayerStorageValue(cid,40003) == -1 then 
		elseif getPlayerFreeCap(cid) < 500 then
			doPlayerSendTextMessage(cid,25,"You must hve more than 500 cap free if you want to take it.")
			return true
				else
		local bag = doPlayerAddItem(cid,1987,1) 
				doAddContainerItem(bag,2432,1) 
				doAddContainerItem(bag,2492,1) 
				doAddContainerItem(bag,2516,1) 
				doAddContainerItem(bag,2160,4) 
				setPlayerStorageValue(cid,40003,1) 
				doPlayerSendTextMessage(cid,25,"You have found a bag.") 
		end
        	else 
		doPlayerSendTextMessage(cid,25,"The is empty.") 
	end     
	return true
end
 
Try it, this is simple but i do not tested it:
Change how many OZ he must have... (there is 500 now)

LUA:
function onUse(cid, item, frompos, item2, topos) 

    if item.uid == 50016 then 
        if getPlayerStorageValue(cid,40003) == -1 then 
		elseif getPlayerFreeCap(cid) < 500 then
			doPlayerSendTextMessage(cid,25,"You must hve more than 500 cap free if you want to take it.")
			return true
				else
		local bag = doPlayerAddItem(cid,1987,1) 
				doAddContainerItem(bag,2432,1) 
				doAddContainerItem(bag,2492,1) 
				doAddContainerItem(bag,2516,1) 
				doAddContainerItem(bag,2160,4) 
				setPlayerStorageValue(cid,40003,1) 
				doPlayerSendTextMessage(cid,25,"You have found a bag.") 
		end
        	else 
		doPlayerSendTextMessage(cid,25,"The is empty.") 
	end     
	return true
end

it did not work, there is no errors in the server logg when i start the server and no errors when i click the chest, but nothing happens when i click the chest, when i use this code line :P
(i copyed yours)
 
Back
Top