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

Add check backpack space & cap function in script please

rudger

Active Member
Joined
Oct 1, 2010
Messages
273
Solutions
1
Reaction score
45
Location
The Netherlands
Hello,

I'm using the following script:

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition)
queststatus = getPlayerStorageValue(cid,100)
	

    if item.actionid == 5001 then
    if queststatus == -1 then
        doPlayerAddItem(cid, 2494, 1)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Demon armor.")
        setPlayerStorageValue(cid, 100, 1)
	
	else
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"It is empty.")
    end

    
	
	elseif item.actionid == 5002 then
    if queststatus == -1 then
        doPlayerAddItem(cid, 2400, 1)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Magic sword.")
        setPlayerStorageValue(cid, 100, 1)
    else
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"It is empty.")
    end

    
	
	elseif item.actionid == 5003 then
    if queststatus == -1 then
        doPlayerAddItem(cid, 2431, 1)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a Stonecutter axe.")
        setPlayerStorageValue(cid, 100, 1)
    else
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"It is empty.")
    end
 
   
   
   elseif item.actionid == 5004 then
    if queststatus == -1 then
        local container = doPlayerAddItem(cid, 1990, 1)
		doAddContainerItem(container,2326,1)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a present.")
		setPlayerStorageValue(cid, 100, 1)
    else
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
    end
    end
return TRUE
end

Now I'd like to have a function implented which checks if I have enough Inventory space.
if I don't, it would come with the text "You don't have enough space."

I'd also like to have a function to check if I have enough cap.
If not it would come with the text "You don't have enough cap".

Please only edit this script, since this script has a teddy bear inside a present ;).
 
Back
Top