SA-MP Forums Archive
[HELP] time convert - 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: [HELP] time convert (/showthread.php?tid=554336)



[HELP] time convert - V4at - 03.01.2015

Hi guys, I need to convert the time from minutes to hours.. For example: 68min --> 1 h. 8 min.

I have this one:

pawn Код:
TimeConvert(seconds)
{
    new tmp[16];
    new minutes = floatround(seconds/60);
    seconds -= minutes*60;
    format(tmp, sizeof(tmp), "%d:%02d", minutes, seconds);
    return tmp;
}
How to change?


Re: [HELP] time convert - Sascha - 03.01.2015

pawn Код:
hour=minutes/60;
Rest=minutes-(hour*60);
format (string, sizeof(string), "%dh %dmin", hour, Rest);