eskimojoe_66
Member
- Reaction score
- 2
How can i get the array value of an expired timer?
function TimerInit takes nothing returns nothing
local integer i=1
set <some global timer array>[0]=CreateTimer()
set <some global integer>=H2I(<some global timer array>[0])-1
loop
exitwhen i>(number of timers to be put into array)
set <some global timer array><i>=CreateTimer()
set i=i+1
endloop
endfunction
</i>
globals
timer array ax
integer Vx
integer nx
endglobals
function DH2I takes handle h returns integer
return h
return 0
endfunction
function TimerInitialization takes nothing returns nothing
local integer i=1
set udg_ax[0]=CreateTimer()
set udg_Vx=DH2I(udg_ax[0])-1
loop
exitwhen i>512
set udg_ax<i>=CreateTimer()
set i=i+1
endloop
set udg_nx=513
endfunction
function GetTimer takes nothing returns timer
if udg_nx==0 then
call BJDebugMsg("ERROR: The timer stack has run out of timers")
return null
endif
set udg_nx=udg_nx-1
return udg_ax[udg_nx]
endfunction
function FreeTimer takes timer t returns nothing
if t!=null then
call PauseTimer(t)
set udg_ax[udg_nx]=t
set udg_nx=udg_nx+1
endif
endfunction
function T2I takes timer t returns integer
return DH2I(t)-udg_Vx
endfunction
</i>
Loop through the array until you find the timer.How can i get the array value of an expired timer?