bpm91
Intermediate OT User
- Joined
- May 23, 2019
- Messages
- 931
- Solutions
- 7
- Reaction score
- 127
- Location
- Brazil
- YouTube
- caruniawikibr
hello, I'm using a script to change beds, but I realized that I can use it outside the house, could anyone tell me how to make it to be used only inside the house?
i use 1.5 nekiro.
this line does not recognize the house i believe it
if getTileHouseInfo(getPlayerPosition(cid)) ~= 0 then
i use 1.5 nekiro.
this line does not recognize the house i believe it
if getTileHouseInfo(getPlayerPosition(cid)) ~= 0 then
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local BEDSINUSE = {1762, 1764, 3842, 1768, 5591, 5593, 5595, 5597, 5599, 5601}
local horizontalpos = {x = toPosition.x+1, y = toPosition.y, z = toPosition.z, stackpos = 1}
local horizontal = getThingfromPos(horizontalpos)
local verticalpos = {x = toPosition.x, y = toPosition.y+1, z = toPosition.z, stackpos = 1}
local vertical = getThingfromPos(verticalpos)
if getTileHouseInfo(getPlayerPosition(cid)) ~= 0 then
if item.itemid == 5603 then --bed kit
if itemEx.itemid == 1756 or itemEx.itemid == 3838 then
doTransformItem(itemEx.uid, 1760)
doTransformItem(horizontal.uid, 1761)
doRemoveItem(item.uid,1)
elseif itemEx.itemid == 3836 or itemEx.itemid == 1858 then
doTransformItem(itemEx.uid, 1754)
doTransformItem(vertical.uid, 1755)
doRemoveItem(item.uid,1)
elseif isInArray(BEDSINUSE,itemEx.itemid) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Somebody is sleeping there!")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can only use modification kits on empty beds.")
end
elseif item.itemid == 5604 then --hammok bed kit
if itemEx.itemid == 1760 or itemEx.itemid == 1756 then
doTransformItem(itemEx.uid, 3838)
doTransformItem(horizontal.uid, 3839)
doRemoveItem(item.uid,1)
elseif itemEx.itemid == 1754 or itemEx.itemid == 1758 then
doTransformItem(itemEx.uid, 3836)
doTransformItem(vertical.uid, 3837)
doRemoveItem(item.uid,1)
elseif isInArray(BEDSINUSE,itemEx.itemid) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Somebody is sleeping there!")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can only use modification kits on empty beds.")
end
elseif item.itemid == 5605 then --cot bed kit
if itemEx.itemid == 1760 or itemEx.itemid == 3838 then
doTransformItem(itemEx.uid, 1756)
doTransformItem(horizontal.uid, 1757)
doRemoveItem(item.uid,1)
elseif itemEx.itemid == 1754 or itemEx.itemid == 3836 then
doTransformItem(itemEx.uid, 1758)
doTransformItem(vertical.uid, 1759)
doRemoveItem(item.uid,1)
elseif isInArray(BEDSINUSE,itemEx.itemid) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Somebody is sleeping there!")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can only use modification kits on empty beds.")
end
elseif item.itemid == 5606 then --Esse nao fiz ainda--
if itemEx.itemid == 7813 or itemEx.itemid == 7817 or itemEx.itemid == 7821 then
doTransformItem(itemEx.uid, 1760)
doTransformItem(horizontal.uid, 1761)
doRemoveItem(item.uid,1)
elseif itemEx.itemid == 7811 or itemEx.itemid == 7815 or itemEx.itemid == 7819 then
doTransformItem(itemEx.uid, 1754)
doTransformItem(vertical.uid, 1755)
doRemoveItem(item.uid,1)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can only use this on modified empty beds.")
end
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can only use this inside a house.")
end
end