rudger
Active Member
Hello,
I'm using the following script:
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
.
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