iLimix Posted August 12, 2017 Share Posted August 12, 2017 how can i get Timer from 05:00 Minute to 00:00 in dxDraw Example: dxDrawText(ladezeit.."%", 1130*(x/1400), 244*(y/900), 1342*(x/1400), 269*(y/900), tocolor(255, 255, 255, 255), 3.00, "default-bold", "center", "center", false, false, false, false, false) function ladeBalken() setTimer(function() ladezeit=ladezeit+1 if(ladezeit==100)then removeEventHandler("onClientRender",root,dxLadebalken) ladezeit=0 end end,50,100) addEventHandler("onClientRender",root,dxLadebalken) end--0.00006 addEvent("ladeBalken",true) addEventHandler("ladeBalken",root,ladeBalken) Link to comment
NeXuS™ Posted August 12, 2017 Share Posted August 12, 2017 local leftTimer = setTimer(function() end, 60000*5, 1) local timeLeft = getTimerDetails(leftTimer) local timeLeft = timeLeft/1000 local minLeft = math.floor(timeLeft/60) local secLeft = timeLeft % 60 local timeText = string.format("%02d", minLeft) .. ":" .. string.format("%02d", secLeft) Try it like this. Link to comment
iLimix Posted August 12, 2017 Author Share Posted August 12, 2017 thx he show me ingame 05:00 But he does not count down local leftTimer = setTimer(function() end, 60000*5, 1) local timeLeft = getTimerDetails(leftTimer) local timeLeft = timeLeft/1000 local minLeft = math.floor(timeLeft/60) local secLeft = timeLeft % 60 local timeText = string.format("%02d", minLeft) .. ":" .. string.format("%02d", secLeft) dxDrawText(timeText.."%", 1130*(x/1400), 244*(y/900), 1342*(x/1400), 269*(y/900), tocolor(255, 255, 255, 255), 3.00, "default-bold", "center", "center", false, false, false, false, false) Link to comment
NeXuS™ Posted August 12, 2017 Share Posted August 12, 2017 Because you have to put it under onClientRender. Link to comment
iLimix Posted August 12, 2017 Author Share Posted August 12, 2017 What would be the other possibility Link to comment
NeXuS™ Posted August 12, 2017 Share Posted August 12, 2017 Nothing else. You can only use dxDrawText under an onClientRender mate. 1 Link to comment
iLimix Posted August 12, 2017 Author Share Posted August 12, 2017 i mean for the Timer maybe as guiCreateLabel? Link to comment
Administrators Lpsd Posted August 12, 2017 Administrators Share Posted August 12, 2017 (edited) yes but you would still at the least need a timer to update the label every second. You might aswell just use dxDrawText in onClientRender - imo its the best way Edited August 12, 2017 by LopSided_ 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