MisterQuestions Posted October 27, 2014 Posted October 27, 2014 Hey can somebody help me? How can i make a coutdown, Not a simple race countdown A countdown of days, hours, minutes, seconds, miliseconds? Can some body help me? I want to draw a text ("dxDrawText") with the countdown. But how? "El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más". Att: -|TG|-Mister[Q]<.
kevenvz Posted October 27, 2014 Posted October 27, 2014 local countdownMS = getTickCount() + 86400000 function getTimeMS(ms) local hours = math.floor(ms/3600000) ms = ms - hours * 3600000 local minutes = math.floor(ms/60000) ms = ms - minutes * 60000 local seconds = math.floor(ms/1000) return hours,minutes,seconds end addEventHandler("onClientRender",root,function() local h,m,s = getTimeMS(countdownMS-getTickCount()) dxDrawText("Hours: "..h.." Minutes: "..m.." Seconds:"..s,100,100) end) I think this should be what you mean, haven't tested it so it might contain buggs.
rtx Posted October 27, 2014 Posted October 27, 2014 Use 'getRealTime()' otherwise 'getTickCount()' would return the machine's runtime. (That would work just fine if you want the countdown to be relative to player's joining)
MisterQuestions Posted October 28, 2014 Author Posted October 28, 2014 But when player join again, the counter restarts... "El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más". Att: -|TG|-Mister[Q]<.
FatalTerror Posted October 28, 2014 Posted October 28, 2014 But when player join again, the counter restarts... Thats why you should use getRealTime instead. Paid developer. Twitter: @willia_am - http://www.williamdasilva.fr
MisterQuestions Posted October 29, 2014 Author Posted October 29, 2014 But how to use it, Can you explain me please ? "El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más". Att: -|TG|-Mister[Q]<.
Castillo Posted October 30, 2014 Posted October 30, 2014 I think you could use the timestamp. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
MisterQuestions Posted December 20, 2014 Author Posted December 20, 2014 How to use it anyone? "El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más". Att: -|TG|-Mister[Q]<.
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