Jump to content

jailTimer


Adde

Recommended Posts

Posted (edited)

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
Posted

why you using "time = getTimerDetails( thatTimer )" as a string in "dxDrawText", it will draw "time" instead of the time that's left.

Posted

I don´t know how I create that and I just made something fast to show how I mean and to ask how i should do and if something was right.

Posted
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) 

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