terciomatos
New Member
- Joined
- Oct 22, 2008
- Messages
- 2
- Reaction score
- 0
TheForgottenServer 831
I have 2 scripts about training room, the first just leave some vocations enter, but can enter more than 1 people in the box.
The second, just one person can enter, but don't ask the vocation, any voc can enter.
I wanna a script who 1 person can enter in the box (trainer) but ask for voc x, y or z (1, 2, 3, 4, 5, 6, 7, 8).
If someone can help me, tks.
I have 2 scripts about training room, the first just leave some vocations enter, but can enter more than 1 people in the box.
function onUse(cid, item, frompos, item2, topos)
reqvoc = getPlayerVocation(cid)
if item.uid == 5637 then
if (reqvoc == 1 or reqvoc == 2 or reqvoc == 3 or reqvoc == 4 or reqvoc == 5 or reqvoc == 6 or reqvoc == 7 or reqvoc == 8) then
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,'Stand in front of the door.')
return 1
end
doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,'Only the characters NOT vip can enter here.')
end
return 1
else
return 0
end
end
The second, just one person can enter, but don't ask the vocation, any voc can enter.
function onUse(cid, item, frompos, item2, topos)
-- <beginning> Training Room script by Alreth.
-- Version 1.0, last edited 2006-06-02 17:39
-- Beginning of editable Variabels
aidNor = 4211 -- Action id for door where training room is north of door
aidSou = 4212 -- Action id for door where training room is south of door
aidWes = 4213 -- Action id for door where training room is west of door
aidEas = 4214 -- Action id for door where training room is east of door
-- End of editable Variabels
emptyRoom = true
charPos = getPlayerPosition(cid)
if (item.actionid == aidNor) then
if (charPos.y < frompos.y) then
othersidePos = {x=frompos.x, y=frompos.y+1, z=frompos.z}
else
othersidePos = {x=frompos.x, y=frompos.y-1, z=frompos.z, stackpos=253}
things = getThingfromPos(othersidePos)
if (things.itemid == 1) then
if (getPlayerLevel(things.uid) > 0) then
emptyRoom = false
end
end
end
elseif (item.actionid == aidSou) then
if (charPos.y > frompos.y) then
othersidePos = {x=frompos.x, y=frompos.y-1, z=frompos.z}
else
othersidePos = {x=frompos.x, y=frompos.y+1, z=frompos.z, stackpos=253}
things = getThingfromPos(othersidePos)
if (things.itemid == 1) then
if (getPlayerLevel(things.uid) > 0) then
emptyRoom = false
end
end
end
elseif (item.actionid == aidEas) then
if (charPos.x > frompos.x) then
othersidePos = {x=frompos.x-1, y=frompos.y, z=frompos.z}
else
othersidePos = {x=frompos.x+1, y=frompos.y, z=frompos.z, stackpos=253}
things = getThingfromPos(othersidePos)
if (things.itemid == 1) then
if (getPlayerLevel(things.uid) > 0) then
emptyRoom = false
end
end
end
elseif (item.actionid == aidWes) then
if (charPos.x < frompos.x) then
othersidePos = {x=frompos.x+1, y=frompos.y, z=frompos.z}
else
othersidePos = {x=frompos.x-1, y=frompos.y, z=frompos.z, stackpos=253}
things = getThingfromPos(othersidePos)
if (things.itemid == 1) then
if (getPlayerLevel(things.uid) > 0) then
emptyRoom = false
end
end
end
end
if (emptyRoom == true) then
doTeleportThing(cid, othersidePos)
doSendMagicEffect(charPos, 2)
doSendMagicEffect(frompos, 12)
doSendMagicEffect(othersidePos, 10)
else
doPlayerSendTextMessage(cid, 22, "Essa sala de treinamento está ocupada.")
end
-- <end> Training Room script by Alreth.
return 1
end
I wanna a script who 1 person can enter in the box (trainer) but ask for voc x, y or z (1, 2, 3, 4, 5, 6, 7, 8).
If someone can help me, tks.