at the forgotten 0.2.11 we can make pvp arenas with onPrepareDeath event (an example i found at the forum)
PS.: pvp areas not working
but at forgotten 0.3 there is not prepareDeath events and onDeath events not working for it :/, cause when we put "return false" the player still dieing.local arena = {
frompos = {x=120, y=32, z=9},
topos = {x=129, y=39, z=9},
exit = {x=125, y=30, z=9}
}
local function exitArena(p)
doSendMagicEffect(p.exit, 10)
doTeleportThing(p.cid, p.exit, FALSE)
end
function onPrepareDeath(cid, killer)
if isInArea(getPlayerPosition(cid), arena.frompos, arena.topos) then
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
addEvent(exitArena, 100, {cid=cid, exit=arena.exit})
end
return FALSE
end
function isInArea(pos, fromPos, toPos)
if pos.x >= fromPos.x and pos.x <= toPos.x then
if pos.y >= fromPos.y and pos.y <= toPos.y then
if pos.z >= fromPos.z and pos.z <= toPos.z then
return true
end
end
end
return false
end
PS.: pvp areas not working