Witam, mam problem:
Gracz po wygranej na arenie 1vs1 nie zostaje teleportowany:
Arena jest pokryta pvp zone, skrypt jest podpiety w login.lua i creaturescripts.xml ;/
Gracz po wygranej na arenie 1vs1 nie zostaje teleportowany:
PHP:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
-- CONFIG --
local a = {
l = {x=274,y=15,z=7}, -- top left pos of arena
r = {x=280,y=19,z=7}, -- bot right pos of arena
e = {x=276,y=26,z=7}, -- loser 'll be teleported in this pos when dies
w = {x=276,y=26,z=7}, -- winner 'll be teleported in this pos when looser dies
}
-- CONFIG --
local p = getCreaturePosition(cid) -- don't touch
local killerPos = getPlayerPosition(lastHitKiller)
local tp = getThingFromPos(killerPos)
if isInRange(p, a.l, a.r) then
doSendMagicEffect(p, CONST_ME_STUN)
doTeleportThing(cid, a.e)
doTeleportThing(tp, a.w)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid))
return FALSE
end
return true
end
Arena jest pokryta pvp zone, skrypt jest podpiety w login.lua i creaturescripts.xml ;/