Terotrificy
Veteran OT User
Hello, i'm having an issue in Othire 1.0 server, when i buy furniture in packages, it's supposed to not work inside the backpack or outside a house tile, however while the first condition works fine, i'm still able to unpack the furniture outside a house.
My intention is to make packpages openables only inside a house floor, seems like the validation is not working. Here is the code:
My intention is to make packpages openables only inside a house floor, seems like the validation is not working. Here is the code:
Lua:
-- by Nottinghster
function onUse(cid, item, fromPosition, itemEx, toPosition)
if (CONSTRUCTIONS[item.itemid] == nil) then
return false
elseif (fromPosition.x == CONTAINER_POSITION) then
doPlayerSendCancel(cid, "You must put the construction kit on the floor first.")
elseif not(getTileHouseInfo(getPlayerPosition(cid)) ~= false) then
doPlayerSendCancel(cid, "You must open the construction kit in your house.")
else
doTransformItem(item.uid, CONSTRUCTIONS[item.itemid])
if item.actionid ~= 0 then
doSetItemActionId(item.uid, item.actionid)
end
doSendMagicEffect(fromPosition, CONST_ME_POFF)
end
return true
end