aki esta
function onPrepareDeath(cid, deathList)
if getPlayerStorageValue(cid,death_times) == -1 then setPlayerStorageValue(cid,death_times,1) end
addEvent(doTeleportThing,1,cid,tp_pos_init[getPlayerGroup(cid)])
local delay = 0
local times = 5*getPlayerStorageValue(cid,death_times)
doCreatureSetNoMove(cid,TRUE)
setPlayerStorageValue(cid,controle_in_delay,1)
for i=times,0,-1 do
addEvent(doMessageWithCheck,delay,cid,21,"Respawn to back: "..i)
delay = 2000 + delay
if i == 0 then
addEvent(doMovePlayer,delay+1000,cid)
end
end
return TRUE
end
function doMessageWithCheck(cid,type,msg)
if isPlayerOnline(getCreatureName(cid)) and getGlobalStorageValue(controle_atived) ~= -1 then
doPlayerSendTextMessage(cid,type,msg)
else
stopEvent(doMessageWithCheck)
end
return TRUE
end
function doMovePlayer(cid)
if isPlayerOnline(getCreatureName(cid)) and getGlobalStorageValue(controle_atived) ~= -1 then
doCreatureSetNoMove(cid, FALSE)
doPlayerSendTextMessage(cid, 21, "Go Go GO!")
setPlayerStorageValue(cid,death_times,getPlayerStorageValue(cid,death_times)+1)
setPlayerStorageValue(cid,controle_in_delay,-1)
end
end