Hi!
I have a problem with a timer funtcion. I would like to call the main function more thank 1 time, and the timer inside the main function can count only once.
Code:
function drawKillingText()
if (text) then
local screenW, screenH = guiGetScreenSize()
dxDrawText ( text, screenW / 2, 100, screenWidth, screenHeight, tocolor(255, 255, 255, 255), 2, "arial", "center", "center", true, false, false, true )
setTimer (function()
text = ""
end, 1250, 1 )
end
end
addEventHandler ( "onClientRender", root, drawKillingText )
So, when the dxDraw text shows up for 1250ms the timer function reset that, but if I call the function agait, the timer can't start. How can I do this? Exit from the function, or reset the timer?
Thanks for helping!