Вообщем не знаю почему но код не работает((
помогите пожалуйста за плюсик
Code
function RespawnHeroesConditions takes nothing returns boolean
return IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO) == true
endfunction
function RespawnHeroes1 takes nothing returns nothing
local timer heroTim=CreateTimer()
local integer heroh=GetHandleId(heroTim)
local unit hero=LoadUnitHandle(udg_hash,heroh,1)
local real heroX=LoadReal(udg_hash,heroh,2)
local real heroY=LoadReal(udg_hash,heroh,3)
local string heroS="Abilities\\Spells\\Human\\Resurrect\\ResurrectCaster.mdl"
local effect heroEffect=AddSpecialEffectTarget(heroS,hero,"origin")
call ReviveHero(hero,heroX,heroY,true)
call FlushChildHashtable(udg_hash,heroh)
call DestroyEffect(heroEffect)
call PauseTimer(heroTim)
call DestroyTimer(heroTim)
set hero=null
set heroS=null
set heroEffect=null
set heroTim=null
endfunction
function RespawnHeroesActions takes nothing returns nothing
local unit hero=GetTriggerUnit()
local timer heroTim=CreateTimer()
local integer heroh=GetHandleId(heroTim)
local real heroX=GetUnitX(hero)
local real heroY=GetUnitY(hero)
call SaveUnitHandle(udg_hash,heroh,1,hero)
call SaveReal(udg_hash,heroh,2,heroX)
call SaveReal(udg_hash,heroh,3,heroY)
call TimerStart(heroTim,7.0,false,function RespawnHeroes1)
set hero=null
set heroTim=null
endfunction