Maths -_- - 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: Maths -_- (
/showthread.php?tid=520142)
Maths -_- -
kamiliuxliuxliux - 17.06.2014
Can someone tell me how to find days, hours, minutes, seconds left until something happens from this value 151654 as seconds if you know what I mean . I'm totally confused.
Re: Maths -_- -
JonathanW - 17.06.2014
I didn't quite get your Question.
Re: Maths -_- -
kamiliuxliuxliux - 17.06.2014
Well we have 151654 seconds, right? Then how to get days, hours, minutes and seconds from that value?
Re: Maths -_- -
Rittik - 17.06.2014
151654 seconds = 1.75525463 days
Re: Maths -_- -
kamiliuxliuxliux - 17.06.2014
Quote:
Originally Posted by Rittik
151654 seconds = 1.75525463 days
|
Yeah, but this value won't be constant, it's gonna be volatile number. So I need all operations, all variables I need etc...
Re: Maths -_- -
Faisal_khan - 17.06.2014
What exactly do you want? A function to get those parameters?
Re: Maths -_- -
kamiliuxliuxliux - 17.06.2014
Yes, exactly
Re: Maths -_- -
iZN - 17.06.2014
http://forum.sa-mp.com/showpost.php?...&postcount=973
Re: Maths -_- -
Rittik - 17.06.2014
You can use
gettime();
Re: Maths -_- -
Kimossab - 17.06.2014
60 seconds - 1 minute
151654 seconds - x
X = 151654 / 60 = 2527,566667 minutes
60 seconds - 1 minute
Y - 0.566667 minutes
Y = 0.566666667 * 60 = 34 seconds
151654 seconds = 2527 minutes and 34 seconds
60 minutes - 1 hour
2527 minutes - Z
Z=2527/60=42.1166666666667 hours
60 minutes - 1 hour
M - 0.11666666666667 hours
M= 0.116666666666666666666667*60 = 7 minutes
151654 seconds = 42 hours 7 minutes and 34 seconds
24 hours - 1 day
42 hours - D
D = 1.75
24 hours - 1 day
H - 0.75 days
H = 0.75*24 = 18 hours
151654 seconds = 1 day 18 hours 7 minutes and 34 seconds
Now with this info get your shit together and find a formula for yourself