Flight Time , Seconds to Minutes
#4

Tired of posting this function, anyway..

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;
}
And for you it's just something like that:
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);
Reply


Messages In This Thread
Flight Time , Seconds to Minutes - by Robbin237 - 19.02.2009, 14:59
Re: Flight Time , Seconds to Minutes - by Joe Staff - 19.02.2009, 15:07
Re: Flight Time , Seconds to Minutes - by Robbin237 - 19.02.2009, 15:10
Re: Flight Time , Seconds to Minutes - by yom - 19.02.2009, 16:14
Re: Flight Time , Seconds to Minutes - by Robbin237 - 20.02.2009, 09:14
Re: Flight Time , Seconds to Minutes - by yom - 20.02.2009, 15:23

Forum Jump:


Users browsing this thread: