Count Down fix?
#5

pawn Code:
seconds = timeleft % 60;
minutes = timeleft / 60;
Very simple and based on the fact that an integer divided by an integer remains an integer; any fractional part is discarded. And as such, for example, 119 divided 60 yields 1.

Also kindly note that your countdown will run into negative values. You have a repeating timer which you cannot kill because you didn't assign it to a variable.
Reply


Messages In This Thread
Count Down fix? - by Fantje - 09.10.2015, 16:10
Re: Count Down fix? - by thefirestate - 09.10.2015, 16:24
Re: Count Down fix? - by Balcan Fox - 09.10.2015, 16:24
Re: Count Down fix? - by Fantje - 09.10.2015, 16:26
Re: Count Down fix? - by Vince - 09.10.2015, 16:31
Re: Count Down fix? - by Balcan Fox - 09.10.2015, 16:35
Re: Count Down fix? - by Vince - 09.10.2015, 16:51
Re: Count Down fix? - by AbyssMorgan - 09.10.2015, 16:53
Re: Count Down fix? - by Balcan Fox - 09.10.2015, 17:05

Forum Jump:


Users browsing this thread: 1 Guest(s)