19.02.2009, 16:14
Tired of posting this function, anyway..
And for you it's just something like that:
pawn Код:
enum tc_method
{
tc_milliseconds,
tc_seconds,
tc_minutes
}
stock TimeConvert(time, &dd, &hh, &mm=0, &ss=0, &ms=0, tc_method:method=tc_milliseconds)
{
if (method == tc_milliseconds)
{
ms = time % 1000;
time = (time - ms)/1000;
ss = time % 60;
time = (time - ss)/60;
}
else if (method == tc_seconds)
{
ss = time % 60;
time = (time - ss)/60;
}
mm = time % 60;
time = (time - mm)/60;
hh = time % 24;
time = (time - hh)/24;
dd = time;
}
pawn Код:
new minutes, seconds;
TimeConvert(FLTime_LosSantos, minutes, minutes, minutes, seconds, .method = tc_seconds);
format(string, sizeof(string), "~w~Flight Time: %02d:%02d", minutes, seconds);