iLimix Posted August 12, 2017 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)
NeXuS™ Posted August 12, 2017 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.
iLimix Posted August 12, 2017 Author 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)
NeXuS™ Posted August 12, 2017 Posted August 12, 2017 Because you have to put it under onClientRender.
NeXuS™ Posted August 12, 2017 Posted August 12, 2017 Nothing else. You can only use dxDrawText under an onClientRender mate. 1
iLimix Posted August 12, 2017 Author Posted August 12, 2017 i mean for the Timer maybe as guiCreateLabel?
MTA Team Lpsd Posted August 12, 2017 MTA Team 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_
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