• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

The door are changing after opning the door.

carre

Advanced OT User
Joined
Apr 23, 2013
Messages
881
Solutions
1
Reaction score
157
Location
Sweden
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.
Screenshot_2.png
Screenshot_3.png

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
 
Solution
Remove this
XML:
 <attribute key="transformUseTo" value="1226"/>
and this
XML:
<attribute key="transformUseTo" value="1225"/>
Then try this one
Lua:
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, 1226)

else
doPlayerSendTextMessage(cid...
Change
Lua:
doTeleportThing(cid, topos)
to
Lua:
doTeleportThing(cid,pos)
All of them not only 1.
 
I thought that is what you wanted since the script already has the teleport function but if you want it to open door then give me the closed door id/opened door id you want.
 
I thought that is what you wanted since the script already has the teleport function but if you want it to open door then give me the closed door id/opened door id you want.
22:36 You see a closed door.
ItemID: [1225], ActionID: [4534].
TransformTo: [1226] (onUse).
Position: [X: 32085] [Y: 31988] [Z: 8].
 
Use this one and post to me how both doors added to items.xml
Lua:
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)

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)

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)

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)

else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end
return 1
else
return 0
end
end
and also add it to data\lib\000-constant.lua in doors line, like this
[1225] = 1226
and remove it from specialDoors line
 
Use this one and post to me how both doors added to items.xml
Lua:
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)

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)

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)

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)

else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end
return 1
else
return 0
end
end
and also add it to data\lib\000-constant.lua in doors line, like this
[1225] = 1226
and remove it from specialDoors line
Screenshot_1.png
I did change lib special door 1225 to 1226
still same


here items.xml doors id

Code:
<item id="1225" article="a" name="closed door">
        <attribute key="type" value="door"/>
        <attribute key="specialDoor" value="1"/>
        <attribute key="blockprojectile" value="1"/>
        <attribute key="transformUseTo" value="1226"/>
    </item>
    
    
    
    <item id="1226" article="an" name="open door">
        <attribute key="type" value="door"/>
        <attribute key="closingDoor" value="1"/>
        <attribute key="transformUseTo" value="1225"/>
    </item>
 
Remove this
XML:
 <attribute key="transformUseTo" value="1226"/>
and this
XML:
<attribute key="transformUseTo" value="1225"/>
Then try this one
Lua:
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, 1226)

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, 1226)

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, 1226)

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, 1226)

else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end
return 1
else
return 0
end
end
 
Solution
Remove this
XML:
 <attribute key="transformUseTo" value="1226"/>
and this
XML:
<attribute key="transformUseTo" value="1225"/>
Then try this one
Lua:
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, 1226)

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, 1226)

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, 1226)

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, 1226)

else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end
return 1
else
return 0
end
end
it works!
Screenshot_1.png



Screenshot_2.png
Post automatically merged:

thank you very so much :)
 
Back
Top