- Joined
- Feb 28, 2014
- Messages
- 70
I created this function to revive a hero on player's start location after certain time, the function is working fine, the only problem is that it doesn't show the time, only the timer window with the message but not the time that left to revive.
This is the code
This is the code
JASS:
function HeroRevive takes unit u, integer i, real r, location p returns nothing
local string s = "Respawn in:"
local timer array t
local timerdialog array td
set u = GetDyingUnit()
set i = GetConvertedPlayerId(GetOwningPlayer(u))
set r = ( 2.00 * I2R(GetHeroLevel(u)) )
set p = GetPlayerStartLocationLoc(Player(i))
call StartTimerBJ( t[i], false, r)
call CreateTimerDialogBJ( t[i], s )
set td[i] = GetLastCreatedTimerDialogBJ()
call TimerDialogDisplayForPlayerBJ( false, td[i], Player(i) )
call TriggerSleepAction(r)
call ReviveHeroLoc( u, p, true )
call PanCameraToTimedLocForPlayer( Player(i), p, 0 )
call SelectUnitForPlayerSingle( u, Player(i) )
call DestroyTimerDialog( td[i] )
call RemoveLocation(p)
set u = null
set t[i] = null
set td[i] = null
endfunction