My script (0.4)
I thought returning false in an onPrepareDeath event will prevent the user from dying.
Some fact's about this:
- I DO see the person being teleported, but after a second or so he disappears and dies
- The corpse appears if I don't handle the onDeath event with a false-return
Any idea why it doesn't work?
Thanks!
Code:
function onPrepareDeath(cid, dl)
if isPlayer(cid) and isInArea(getCreaturePosition(cid), {x=876,y=1010,z=9},{x=886,y=1020,z=9}) then
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
doTeleportThing(cid, {x=886,y=1007,z=8})
doSendMagicEffect({x=886,y=1007,z=8}, 10)
return false
end
return true
end
I thought returning false in an onPrepareDeath event will prevent the user from dying.
Some fact's about this:
- I DO see the person being teleported, but after a second or so he disappears and dies
- The corpse appears if I don't handle the onDeath event with a false-return
Any idea why it doesn't work?
Thanks!