tuantai120
Cool Member
- Reaction score
- 1
i just learn jass , i need tut make spell slide , jass not vjass
thx very much
thx very much
//credit to Rising_Dusk
//Obviously this IS vJass notation by using a global block, but it's just representative.
globals
timer array ax
integer Vx //Archaic, replace the Vx stuff with arbitrary offset as applicable
integer nx
endglobals
function H2I takes handle h returns integer
return h
return 0
endfunction
//call this at map init
function TimerInitialization takes nothing returns nothing
local integer i=1
set ax[0]=CreateTimer()
set Vx=H2I(ax[0])-1
loop
exitwhen i>512
set ax<i>=CreateTimer()
set i=i+1
endloop
set nx=512+1
endfunction
function GetTimer takes nothing returns timer
if nx==0 then
call BJDebugMsg("ERROR: The timer stack has run out of timers")
return null
endif
set nx=nx-1
return ax[nx]
endfunction
function ReleaseTimer takes timer t returns nothing
if t!=null then
call PauseTimer(t)
set ax[nx]=t
set nx=nx+1
endif
endfunction
function T2I takes timer t returns integer
return H2I(t)-Vx
endfunction
</i>