When creating a local timer and calling it, how do you call functions that take variables? Whenever I do something like this:
{
function second takes unit x, unit z returns nothing
function code
endfunction
function first takes nothing returns nothing
local timer t
local unit x
local unit z
set x = ABC
set z = DEF
set t = CreateTimer()
call TimerStart(t, 0.10, true, function second(x,z))
call TriggerSleepAction(2.00)
call DestroyTimer(t)
set x = null
set z = null
endfunction
}
It gives me an error, "Expected '". Apparently it doesn't like me calling a function that takes parameters with a timer. Is there any way to do this? Thanks.
{
function second takes unit x, unit z returns nothing
function code
endfunction
function first takes nothing returns nothing
local timer t
local unit x
local unit z
set x = ABC
set z = DEF
set t = CreateTimer()
call TimerStart(t, 0.10, true, function second(x,z))
call TriggerSleepAction(2.00)
call DestroyTimer(t)
set x = null
set z = null
endfunction
}
It gives me an error, "Expected '". Apparently it doesn't like me calling a function that takes parameters with a timer. Is there any way to do this? Thanks.