xXMADEXx Posted July 10, 2013 Share Posted July 10, 2013 Hi guys, so, i've never used "getTickCount()" before, and I hear its a lot better then using setTimer. I just have one problem.. The DX text will only show for 1 frame every second.. Im not really sure how to fix it either... local sx, sy = guiGetScreenSize ( ) local LastTick = 1000 addEventHandler ( "onClientRender", root, function ( ) local lc = getTickCount ( ) if ( lc-LastTick >= 1000 ) then dxDrawText ( lc, 0, 0, sx, sy, tocolor ( 202, 202, 202, 255 ), 3, "default-bold", "center", "center" ) LastTick = lc else return end end ) Link to comment
Castillo Posted July 10, 2013 Share Posted July 10, 2013 I don't really understand what do you mean. Link to comment
Tete omar Posted July 10, 2013 Share Posted July 10, 2013 Shouldn't you define 2 getTickCount and compare them to get how much time has passed in ms? Link to comment
Moderators IIYAMA Posted July 10, 2013 Moderators Share Posted July 10, 2013 local sx, sy = guiGetScreenSize ( ) local LastTick = 1000 local DXToRender = 0 addEventHandler ( "onClientRender", root, function ( ) local lc = getTickCount ( ) if ( lc-LastTick >= 1000 ) then LastTick = lc DXToRender = 30 end if DXToRender > 0 then dxDrawText ( lc, 0, 0, sx, sy, tocolor ( 202, 202, 202, 255 ), 3, "default-bold", "center", "center" ) DXToRender = DXToRender-1 end end ) You forgot to set how many frames it have to render. 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