Jump to content

jailTimer


Adde

Recommended Posts

Hello, I am planning to create a screen text for the time that´s left on a timer. Can I get any suggestion how I should do it? I read about it should be something like this:

If I name the timer and then use that later..

  
thatTimer = setTimer ( setElementPosition, 30000, 2, x, y, z ) 
  
local screenWidth, screenHeight = guiGetScreenSize ( ) 
  
function timercount() 
getTimerDetails ( thatTimer ) 
If isTimer(thatTimer) then 
dxDrawText () 
addEventHandler("onClientRender", root, timercount) 
  

This is maybe far from done but this is some parts that I have read should be a part of it.

Edited by Guest
Link to comment
local thatTimer = setTimer ( setElementPosition, 30000, 2, x, y, z ) 
local screenWidth, screenHeight = guiGetScreenSize ( ) 
  
function timercount() 
    if isTimer ( thatTimer ) then 
        local time = getTimerDetails ( thatTimer ) 
        dxDrawText ( tostring ( time ), screenWidth / 2,screenHeight / 2 ) 
    else 
        dxDrawText ( 'Nothing', screenWidth / 2,screenHeight / 2 ) 
    end 
end 
addEventHandler("onClientRender", root, timercount) 

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