Time conversion
#1

Hey, i've made a little function for an RP server i've developing, which converts minutes into days, hours & minutes. My problem is that when the minute mark reaches 60+ with the convert minute function, it just carries on, I was wondering if I could stop that and reset it to 0 without disrupting the days & hours process.

Sorry, if that was hard to understand.

Код:
stock ConvertTime(time) {
	new String[300];

	new day = time / 1440;
	new hour = time / 60;
	new minute = time;

	format(String, sizeof String, "{FF0000}%d {FFFFFF}days, {FF0000}%d {FFFFFF}hours and {FF0000}%d {FFFFFF}minutes", day, hour, minute);
    return String;
}
Reply


Messages In This Thread
Time conversion - by Luis- - 13.03.2013, 19:42
Re: Time conversion - by [MG]Dimi - 13.03.2013, 19:59
Re: Time conversion - by Luis- - 13.03.2013, 20:06
Re: Time conversion - by [MG]Dimi - 13.03.2013, 20:07
Re: Time conversion - by Vince - 13.03.2013, 21:01
Re: Time conversion - by Luis- - 13.03.2013, 21:08
Re: Time conversion - by Vince - 13.03.2013, 21:34

Forum Jump:


Users browsing this thread: 1 Guest(s)