SA-MP Forums Archive
Get seconds and minutes. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Get seconds and minutes. (/showthread.php?tid=413673)



Get seconds and minutes. - BlackRaven - 06.02.2013

Hello all Im needing of some help, i need to get the seconds and minutes from a timer, how can i do it?


Re: Get seconds and minutes. - RajatPawar - 06.02.2013

You need to get seconds and minutes from a timer? How is that possible, you set the timer, so how is the question of getting it, coming from? Please explain your thing properly!


Re: Get seconds and minutes. - 3ventic - 06.02.2013

Set a repeatedly running timer for 1 second and increment a value every time it runs (count seconds) and have a function to convert the seconds into minutes & seconds.

minutes = floor(seconds/60)
seconds -= 60*minutes

(I don't know pawn but that's the idea)


Re: Get seconds and minutes. - BlackRaven - 06.02.2013

I want to convert this this time in milliseconds 113000 to minutes and seconds.


Re: Get seconds and minutes. - Cameltoe - 06.02.2013

113000 / 1000 ( MS to seconds ) = 113 / 60 ( Seconds to minutes ) = 1,83 minutes.


Re: Get seconds and minutes. - BlackRaven - 06.02.2013

Thanks Cameltoe it worked rep++;


Re: Get seconds and minutes. - ThePhenix - 06.02.2013

That's simple math**