Jump to content

[HELP] Kill timer function


John_Scott

Recommended Posts

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!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...