zandro3210 5 Postado Agosto 12, 2010 Share Postado Agosto 12, 2010 -- pvp arena lever function onUse(cid, item, frompos, item2, topos) if item.uid == 65535 and item.itemid == 1945 then player1pos = {x=32367, y=31780, z=9, stackpos=253} player1 = getThingfromPos(player1pos) player2pos = {x=32367, y=31782, z=9, stackpos=253} player2 = getThingfromPos(player2pos) if player1.itemid > 0 and player2.itemid > 0 then arenalevel = 30 player1level = getPlayerLevel(player1.uid) player2level = getPlayerLevel(player2.uid) if player1level >= arenalevel and player2level >= arenalevel then for arenax = 32346,32365 do for arenay = 31778,31783 do arenapos = {x=arenax, y=arenay, z=10, stackpos=253} arenacreature = getThingfromPos(arenapos) if arenacreature.itemid > 0 then doPlayerSendCancel(cid,"Wait for current duel to end.") return 1 end end end nplayer1pos = {x=32346, y=31781, z=10} nplayer2pos = {x=32365, y=31782, z=10} doSendMagicEffect(player1pos,2) doSendMagicEffect(player2pos,2) doTeleportThing(player1.uid,nplayer1pos) doTeleportThing(player2.uid,nplayer2pos) doSendMagicEffect(nplayer1pos,10) doSendMagicEffect(nplayer2pos,10) doPlayerSendTextMessage(player1.uid,18,"FIGHT!") doPlayerSendTextMessage(player2.uid,18,"FIGHT!") else doPlayerSendCancel(cid,"Both fighters must have level 30.") end else doPlayerSendCancel(cid,"You need 2 players for a duel.") end else return 0 end return 1 end o que esta erradp minha alavanca n funciona =/ Ja arrumei mals pela pergutna invão =/ Link para o comentário Compartilhar em outros sites More sharing options...
0 joaohd 200 Postado Agosto 13, 2010 Share Postado Agosto 13, 2010 (editado) Tente: function onUse(cid, item) local config = { {x=32367, y=31780, z=9, stackpos=253} = {x=32346, y=31781, z=10}, {x=32367, y=31782, z=9, stackpos=253} = {x=32365, y=31782, z=10} } local arena ={ topLeftPos = {x = 32346, y = 32365, z = 10}, lowerRightPos = {x = 31778, y = 31783, z = 10 } if item.itemid == 1945 then for from, to in pairs(config) do if isPlayer(getThingfromPos(from).uid) then if getPlayerLevel(getThingfromPos(from).uid) >= 30 then for arX = arena.topLeftPos.x, arena.lowerRightPos.x do for arY = arena.topLeftPos.y, arena.lowerRightPos.y do areaArena = {x = arX, y = arY, z = arena.topLeftPos.z, stackpos = 253} if getThingfromPos(areaArena).uid ~= 0 then doPlayerSendCancel(cid, "Wait for current duel to end.") doTransformItem(item.uid, .item.itemid+1) else doTeleportThing(getThingfromPos(from).uid, to) doTransformItem(item.uid, .item.itemid+1) end end end else doPlayerSendCancel(cid, "Both players must be level 30 or higher.") doTransformItem(item.uid, .item.itemid+1) end else doPlayerSendCancel(cid, "Both fighters must to be players.") doTransformItem(item.uid, .item.itemid+1) end end elseif item.itemid == 1946 then doTransformItem(item.uid, .item.itemid-1) end return TRUE end Editado: Já foi resolvido... Reportado para moverem flw Editado Agosto 13, 2010 por apocarai Link para o comentário Compartilhar em outros sites More sharing options...
0 Henrique Moura 193 Postado Agosto 13, 2010 Share Postado Agosto 13, 2010 sAnado - movido. Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
zandro3210 5
-- pvp arena lever
function onUse(cid, item, frompos, item2, topos)
if item.uid == 65535 and item.itemid == 1945 then
player1pos = {x=32367, y=31780, z=9, stackpos=253}
player1 = getThingfromPos(player1pos)
player2pos = {x=32367, y=31782, z=9, stackpos=253}
player2 = getThingfromPos(player2pos)
if player1.itemid > 0 and player2.itemid > 0 then
arenalevel = 30
player1level = getPlayerLevel(player1.uid)
player2level = getPlayerLevel(player2.uid)
if player1level >= arenalevel and player2level >= arenalevel then
for arenax = 32346,32365 do
for arenay = 31778,31783 do
arenapos = {x=arenax, y=arenay, z=10, stackpos=253}
arenacreature = getThingfromPos(arenapos)
if arenacreature.itemid > 0 then
doPlayerSendCancel(cid,"Wait for current duel to end.")
return 1
end
end
end
nplayer1pos = {x=32346, y=31781, z=10}
nplayer2pos = {x=32365, y=31782, z=10}
doSendMagicEffect(player1pos,2)
doSendMagicEffect(player2pos,2)
doTeleportThing(player1.uid,nplayer1pos)
doTeleportThing(player2.uid,nplayer2pos)
doSendMagicEffect(nplayer1pos,10)
doSendMagicEffect(nplayer2pos,10)
doPlayerSendTextMessage(player1.uid,18,"FIGHT!")
doPlayerSendTextMessage(player2.uid,18,"FIGHT!")
else
doPlayerSendCancel(cid,"Both fighters must have level 30.")
end
else
doPlayerSendCancel(cid,"You need 2 players for a duel.")
end
else
return 0
end
return 1
end
o que esta erradp minha alavanca n funciona =/
Ja arrumei mals pela pergutna invão =/
Link para o comentário
Compartilhar em outros sites
2 respostass a esta questão
Posts Recomendados