Witam prosze o pomoc w ustawieniu pvp areny
Info:
1.Kolesie kturzy cha isc na arene to pierwszy staje na(X178,y70,z7) drugi koles(x180,y70,z7)
2.Dzwignia znajduje sie na(x179,y70,z7)
3.po nacisnieciu na dzwignie ma teleportowac pierwszego kolesia na(x172,y77,z7)a drugiego kolesia na(x184,y71,z7)
Arena.lua
Info:
1.Kolesie kturzy cha isc na arene to pierwszy staje na(X178,y70,z7) drugi koles(x180,y70,z7)
2.Dzwignia znajduje sie na(x179,y70,z7)
3.po nacisnieciu na dzwignie ma teleportowac pierwszego kolesia na(x172,y77,z7)a drugiego kolesia na(x184,y71,z7)
Arena.lua
arenalever.lua-- pvp arena lever
function onUse(cid, item, frompos, item2, topos)
if item.uid == 7666 and item.itemid == 1945 then
player1pos = {x=186, y=45, z=6, stackpos=253}
player1 = getThingfromPos(player1pos)
player2pos = {x=181, y=45, z=6, stackpos=253}
player2 = getThingfromPos(player2pos)
if player1.itemid > 0 and player2.itemid > 0 then
arenalevel = 50
player1level = getPlayerLevel(player1.uid)
player2level = getPlayerLevel(player2.uid)
if player1level >= arenalevel and player2level >= arenalevel then
for arenax = 179,188 do
for arenay = 47,53 do
arenapos = {x=arenax, y=arenay, z=6, stackpos=253}
arenacreature = getThingfromPos(arenapos)
if arenacreature.itemid > 0 then
doPlayerSendCancel(cid,"Poczekaj az aktualny pojedynek sie skonczy.")
return 1
end
end
end
nplayer1pos = {x=186, y=50, z=6}
nplayer2pos = {x=181, y=50, z=6}
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,"Oboje graczy musi miec minimum 50lvl.")
end
else
doPlayerSendCancel(cid,"Potrzebujesz 2 graczy zeby stoczyc pojedynek.")
end
else
return 0
end
return 1
end
-- pvp arena lever
function onUse(cid, item, frompos, item2, topos)
if item.uid == 7001 and item.itemid == 1945 then
player1pos = {x=178, y=70, z=7, stackpos=253}
player1 = getThingfromPos(player1pos)
player2pos = {x=180, y=70, z=7, stackpos=253}
player2 = getThingfromPos(player2pos)
if player1.itemid > 0 and player2.itemid > 0 then
arenalevel = 35
player1level = getPlayerLevel(player1.uid)
player2level = getPlayerLevel(player2.uid)
if player1level >= arenalevel and player2level >= arenalevel then
for arenax = 121,128 do
for arenay = 33,37 do
arenapos = {x=arenax, y=arenay, z=9, stackpos=253}
arenacreature = getThingfromPos(arenapos)
if arenacreature.itemid > 0 then
doPlayerSendCancel(cid,"Poczekaj az aktualny pojedynek sie skonczy.")
return 1
end
end
end
nplayer1pos = {x=178, y=74, z=7}
nplayer2pos = {x=179, y=74, z=7}
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,"Oboje graczy musi miec minimum 35lvl.")
end
else
doPlayerSendCancel(cid,"Potrzebujesz 2 graczy zeby stoczyc pojedynek.")
end
else
return 0
end
return 1
end