pato cantu
New Member
- Joined
- Jan 22, 2008
- Messages
- 3
- Reaction score
- 0
Can Someone give me the scripts of vocation doors?
function onUse(cid, item, frompos, item2, topos)
if item.uid == 10092 then
if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then
doPlayerSendTextMessage(cid, 22, "You can pass, you are a Paladin.")
pos = getPlayerPosition(cid)
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,'Please stand in front of the door.')
return 1
end
doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,'You can\'t pass, you aren\'t a Paladin.')
end
return 1
else
return 0
end
end
function onUse(cid, item, frompos, item2, topos)
if item.uid == 10093 then
if getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 then
doPlayerSendTextMessage(cid, 22, "You can pass, you are a Druid.")
pos = getPlayerPosition(cid)
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,'Please stand in front of the door.')
return 1
end
doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,'You can\'t pass, you aren\'t a Druid.')
end
return 1
else
return 0
end
end
function onUse(cid, item, frompos, item2, topos)
if item.uid == 10094 then
if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 then
doPlayerSendTextMessage(cid, 22, "You can pass, you are a Sorcerer.")
pos = getPlayerPosition(cid)
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,'Please stand in front of the door.')
return 1
end
doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,'You can\'t pass, you aren\'t a Sorcerer.')
end
return 1
else
return 0
end
end
function onUse(cid, item, frompos, item2, topos)
if item.uid == 10091 then
if getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 8 then
doPlayerSendTextMessage(cid, 22, "You can pass, you are a Knight.")
pos = getPlayerPosition(cid)
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,'Please stand in front of the door.')
return 1
end
doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,'You can\'t pass, you aren\'t a Knight.')
end
return 1
else
return 0
end
end
No, you must put the ID of the item there.if item.uid == 10091 then
Soo i must give action id 10091 , ye ?
-- Made by Cain
-- Otfans.net
-- Vocation door script
-- CONFIG --
-- Door unique ID - Change to an unused uniqe ID --
local door = 9880
local druid = {1, 5} -- Druid vocation ID's
local sorc = {2, 6} -- Sorcerer vocation ID's
local paladin = {3, 7} -- Paladin vocation ID's
local knight = {4, 8} -- Knight vocation ID's
-- Errors --
local errors {
druid = "Only druids can enter this door."
sorc = "Only sorcerers can enter this door."
paladin = "Only paladins can enter this door."
knight = "Only knights can enter this door."
}
-- END CONFIG --
function onUse(cid, item, frompos, item2, topos)
if isPlayer(cid) == TRUE then
if item.uid == door and getPlayerVocation(cid) == druid then
doPlayerSendTextMessage(cid, 22, "You can pass.")
else
if lookdir == 0 then
doTeleportThing(cid, playerPos.y -= 1)
doPlayerSendCancel(cid, errors.druid)
elseif lookdir == 1 then
doTeleportThing(cid, playerPos.x -= 1)
doPlayerSendCancel(cid, errors.druid)
elseif lookdir == 2 then
doTeleportThing(cid, playerPos.y += 1)
doPlayerSendCancel(cid, errors.druid)
elseif lookdir == 3 then
doTeleportThing(cid, playerPos.x += 1)
doPlayerSendCancel(cid, errors.druid)
end
end
if item.uid == door and getPlayerVocation(cid) == sorc then
doPlayerSendTextMessage(cid, 22, "You can pass.")
else
if lookdir == 0 then
doTeleportThing(cid, playerPos.y -= 1)
doPlayerSendCancel(cid, errors.sorc)
elseif lookdir == 1 then
doTeleportThing(cid, playerPos.x -= 1)
doPlayerSendCancel(cid, errors.sorc)
elseif lookdir == 2 then
doTeleportThing(cid, playerPos.y += 1)
doPlayerSendCancel(cid, errors.sorc)
elseif lookdir == 3 then
doTeleportThing(cid, playerPos.x += 1)
doPlayerSendCancel(cid, errors.sorc)
end
end
if item.uid == door and getPlayerVocation(cid) == paladin then
doPlayerSendTextMessage(cid, 22, "You can pass.")
else
if lookdir == 0 then
doTeleportThing(cid, playerPos.y -= 1)
doPlayerSendCancel(cid, errors.paladin)
elseif lookdir == 1 then
doTeleportThing(cid, playerPos.x -= 1)
doPlayerSendCancel(cid, errors.paladin)
elseif lookdir == 2 then
doTeleportThing(cid, playerPos.y += 1)
doPlayerSendCancel(cid, errors.paladin)
elseif lookdir == 3 then
doTeleportThing(cid, playerPos.x += 1)
doPlayerSendCancel(cid, errors.paladin)
end
end
if item.uid == door and getPlayerVocation(cid) == knight then
doPlayerSendTextMessage(cid, 22, "You can pass.")
else
if lookdir == 0 then
doTeleportThing(cid, playerPos.y -= 1)
doPlayerSendCancel(cid, errors.knight)
elseif lookdir == 1 then
doTeleportThing(cid, playerPos.x -= 1)
doPlayerSendCancel(cid, errors.knight)
elseif lookdir == 2 then
doTeleportThing(cid, playerPos.y += 1)
doPlayerSendCancel(cid, errors.knight)
elseif lookdir == 3 then
doTeleportThing(cid, playerPos.x += 1)
doPlayerSendCancel(cid, errors.knight)
end
end
end
return TRUE
end
<!-- Vocation door -->
<action uniqueid="9880" script="other/vocation_door.lua"/>