xXMADEXx Posted February 27, 2013 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) The Ultimate Lua Tutorial! | MTA PHP SDK
Max+ Posted February 27, 2013 Posted February 27, 2013 https://wiki.multitheftauto.com/wiki/Ser ... _functions - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
xXMADEXx Posted February 27, 2013 Author Posted February 27, 2013 This is a client side script... The Ultimate Lua Tutorial! | MTA PHP SDK
Max+ Posted February 27, 2013 Posted February 27, 2013 triggerServerEvent ? - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
codeluaeveryday Posted February 27, 2013 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) Tutorials: => getOnlineAdmins() => [TUT] Better Join Country => [TUT] Updating admin countries => [TUT] Updating admin flags Server: K@N Zombies / Freeroam
myonlake Posted February 27, 2013 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. If I helped you, please click the like button on the right Thanks!
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