Micool777
New Member
- Joined
- Aug 25, 2012
- Messages
- 14
- Reaction score
- 0
LUA:
function onStepIn(cid, item, position, fromPosition)
if item.actionid > 30020 and item.actionid < 30100 then
doPlayerSetTown(cid, item.actionid - 30021)
elseif item.actionid == 1776 then
local toparea={x = 445, y = 59, z = 7}
local botarea={x = 445, y = 64, z = 7}
local fromPos={x=444,y=59,z=7}
local toPos={x=446,y=64,z=7}
if not isPlayer(cid) then
return true
end
--[1]
local amount = 0
for x = fromPos.x, toPos.x do
for y = fromPos.y, toPos.y do
for z = fromPos.z, toPos.z do
local pid = getThingfromPos({x=x,y=y,z=z})
if (isPlayer(pid) and getPlayerLevel(pid) >= 100) then
amount = amount+1
--doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, pid)
else
end
end
end
end
--[2]
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, amount)
if amount >= 2 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "There are already " ..amount.. " duelers in the room.")
doTeleportThing(cid,fromPosition)
doSendMagicEffect(fromPosition, CONST_ME_POOF)
end
if amount == 1 then
doTeleportThing(cid,toparea)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "There are " ..amount.. " duelers in the room.")
doTeleportThing(cid,botarea)
end
end
return true
end
Last edited: