Adde Posted July 9, 2013 Share Posted July 9, 2013 (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 July 9, 2013 by Guest Link to comment
gokalpfirat Posted July 9, 2013 Share Posted July 9, 2013 There arent any true thing on that code. First you should know the functions parameters. Link to comment
manve1 Posted July 9, 2013 Share Posted July 9, 2013 why you using "time = getTimerDetails( thatTimer )" as a string in "dxDrawText", it will draw "time" instead of the time that's left. Link to comment
iPrestege Posted July 9, 2013 Share Posted July 9, 2013 You should to check if this timer still exists : isTimer Link to comment
Adde Posted July 9, 2013 Author Share Posted July 9, 2013 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. Link to comment
iPrestege Posted July 9, 2013 Share Posted July 9, 2013 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now