carre
Advanced OT User
Hello otlanders
It's me again my friends
When I open the door then it changes other types of doors.
I want the door to stay the same.
here the vocdoor.lua
It's me again my friends
When I open the door then it changes other types of doors.
I want the door to stay the same.
here the vocdoor.lua
Code:
function onUse(cid, item, frompos, item2, topos)
local playervoc = getPlayerVocation(cid)
local pos = getPlayerPosition(cid)
if item.actionid == (4531) then
if getPlayerVocation(cid) == 1 or playervoc == 5 then
if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,'You need to be in front of the door.')
return 1
end
doTeleportThing(cid, topos)
doTransformItem(item.uid, 1258)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end
elseif item.actionid == (4532) then
if getPlayerVocation(cid) == 2 or playervoc == 6 then
if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,'You need to be in front of the door.')
return 1
end
doTeleportThing(cid, topos)
doTransformItem(item.uid, 1258)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end
elseif item.actionid == (4533) then
if getPlayerVocation(cid) == 3 or playervoc == 7 then
if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,'You need to be in front of the door.')
return 1
end
doTeleportThing(cid, topos)
doTransformItem(item.uid, 1258)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end
elseif item.actionid == (4534) then
if getPlayerVocation(cid) == 4 or playervoc == 8 then
if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,'You need to be in front of the door.')
return 1
end
doTeleportThing(cid, topos)
doTransformItem(item.uid, 1258)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end
return 1
else
return 0
end
end