massuco
Brazilian, sorry for my bad english XD
I am using this script trying to check the space in backpack, if have free space, it receive a reward, if not, a message with "you have no room etc.." But i dont know how to use the function to check the room on backpack. PLEASE, someone help me?
I was trying using:
local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK)
if (getContainerCap(bp.uid) ~= 0) then
but dont works
I was trying using:
local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK)
if (getContainerCap(bp.uid) ~= 0) then
but dont works
Code:
function onUse(cid, item, frompos, item2, topos)
if item.uid == 50124 then
queststatus = getPlayerStorageValue(cid,50125)
if queststatus == -1 then
local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK)
if (getContainerCap(bp.uid) ~= 0) then
doPlayerSendTextMessage(cid,22,"You have no room")
else
if (getPlayerFreeCap(cid) >= 80) then
doPlayerSendTextMessage(cid,22,"You have found a obsidian lance.")
doPlayerAddItem(cid, 2425, 1)
setPlayerStorageValue(cid,50125,1)
else
doPlayerSendTextMessage(cid,22,"You have found a obsidian lance. Weighing 80.00 oz it is too heavy.")
end
end
else
doPlayerSendTextMessage(cid,22,"The dead human is empty.")
end
else
return 0
end
return 1
end