rudger
Active Member
I'd like this to be added to my quest chest:
if backpack space < 1 then
doPlayerSendTextMessage(cid,22, "Sorry, you do not have enough space in your backpack.")
Notice: I don't have the function getItemWeightById and I'm using Avesta 7.6
My script:
I think I have to use something like: doCreateItemEx and doPlayerAddItemEx .
But I'm just getting the error: luaDoPlayerAddItemEx<>. Item not found all the time.
if backpack space < 1 then
doPlayerSendTextMessage(cid,22, "Sorry, you do not have enough space in your backpack.")
Notice: I don't have the function getItemWeightById and I'm using Avesta 7.6
My script:
LUA:
function onUse(cid, item, frompos, item2, topos)
queststatus = getPlayerStorageValue(cid,16222)
if item.uid == 16222 then
if queststatus == 0 or queststatus == -1 and getPlayerFreeCap(cid) < 100 then
doPlayerSendTextMessage(cid,22,"You have found a chain armor. Weighing 100 oz. It is too heavy.")
elseif queststatus == 0 or queststatus == -1 and getPlayerFreeCap(cid) >= 100 then
doPlayerSendTextMessage(cid,22,"You have found a chain armor.")
doPlayerAddItem(cid,2464,1)
setPlayerStorageValue(cid,16222,1)
else
doPlayerSendTextMessage(cid,22,"The chest is empty.")
end
else
return 0
end
return 1
end
I think I have to use something like: doCreateItemEx and doPlayerAddItemEx .
But I'm just getting the error: luaDoPlayerAddItemEx<>. Item not found all the time.
Last edited: