xXMADEXx Posted February 27, 2013 Share Posted February 27, 2013 Hey guys, i have made this basic script, but i dont know how to make the dx text count. function timerText() dxDrawBorderedTitleText("Time Left: ", 0, 0, 1279, 65, tocolor(0, 255, 255, 255), 2, "default", "center", "center", false, false, true, false, false) end function startJailGUITimer(player,timer) addEventHandler('onClientRender',root,timerText) setTimer( function () removeEventHandler("onClientRender",root,timerText) end, timer * 1000, 1 ) end addEvent("jail:startDxTimer",true) addEventHandler("jail:startDxTimer",root,startJailGUITimer) Link to comment
Max+ Posted February 27, 2013 Share Posted February 27, 2013 https://wiki.multitheftauto.com/wiki/Ser ... _functions Link to comment
xXMADEXx Posted February 27, 2013 Author Share Posted February 27, 2013 This is a client side script... Link to comment
codeluaeveryday Posted February 27, 2013 Share Posted February 27, 2013 This should do it my awesome friend, function timerText() dxDrawBorderedTitleText("Time Left: "..(timeLeft or 'BUGGED'), 0, 0, 1279, 65, tocolor(0, 255, 255, 255), 2, "default", "center", "center", false, false, true, false, false) end function startJailGUITimer(player,timer) addEventHandler('onClientRender',root,timerText) setTimer( function () removeEventHandler("onClientRender",root,timerText) end, timer * 1000, 1 ) timeLeft = timer setTimer( function() timeLeft = timeLeft - 1 end, 1000, timer ) end addEvent("jail:startDxTimer",true) addEventHandler("jail:startDxTimer",root,startJailGUITimer) Link to comment
myonlake Posted February 27, 2013 Share Posted February 27, 2013 You can also do it without any timers, which might decrease the chance of lag and timing out. Just make a variable and make it increase itself and when it hits a certain amount, it will decrease the time variable. This might not work well on old machines since the rendering isn't working well over there, so the "timer" would be slow. Maybe if you implement a synchronization with the server, it could work out. But if you think you don't need to worry about any of these issues, go ahead and use timers. 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