Jump to content

Save timer


Kernal

Recommended Posts

Hey guys I want to ask you about something how I can save the timer I mean if I create a timer using setTimer function and the player leave the server I want to save it using SQL but how I can get the correct timer reaming in ?

I guess i can use this function :

getTimerDetails 

Greetings!

Link to comment
Hey guys I want to ask you about something how I can save the timer I mean if I create a timer using setTimer function and the player leave the server I want to save it using SQL but how I can get the correct timer reaming in ?

I guess i can use this function :

getTimerDetails 

Greetings!

Yes you can and here's an example :

aTimer = setTimer (  
    function (          ) 
                outputChatBox ( 'Timer End' ) 
            end,5000,1 
        ) 
addCommandHandler ( 'data', 
    function (      ) 
        if aTimer and isTimer ( aTimer ) then 
            local remaining, executesRemaining, totalExecutes = getTimerDetails ( aTimer ) 
                outputChatBox ( ' #FF0000'..executesRemaining..':#0000FF'..totalExecutes..':#FF00FF'..remaining..' ',255,255,255,true       ) 
        else 
                    outputChatBox ( '* The timer doesnt exists.' ) 
            end  
    end ) 

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...