raskaster
BBC Radio
- Joined
- Aug 10, 2009
- Messages
- 13
- Reaction score
- 0
I have a problem with the function "onPrepareDeath(cid, deathList)". Currently I create the arena, and this function is not working properly.
Script:
The problem is that the script will teleport me, "not dying", but I have a 0 hp and can not move.
Help me >.<
Script:
Code:
local config =
{
fromPosition = {x=1058,y=1026,z=6},
toPosition = {x=1065,y=1030,z=6},
gl_storage = 16891,
storage = 3989
}
function onPrepareDeath(cid, deathList)
local exit = getTownTemplePosition(getPlayerTown(cid))
if isPlayer(cid) then
if isInRange(getPlayerPosition(cid), config.fromPosition, config.toPosition) then
if doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), true) == true then
if doTeleportThing(cid, exit) == TRUE then
doSendMagicEffect(exit, 10)
doPlayerSendTextMessage(cid,22,'[ARENA]: Zostales pokonany.')
doCreatureSetStorage(cid, config.storage, -1)
doSetStorage(config.gl_storage, -1)
return FALSE
end
end
end
end
return FALSE
end
The problem is that the script will teleport me, "not dying", but I have a 0 hp and can not move.
Help me >.<