any way?
#2

Here's a function I wrote a while back that you may find useful:

pawn Код:
/*Usage: The seconds parameter should be the amount of seconds you want to convert and
the rest of the parameters should be variables to store the integer value for each of the
time values*/

stock formatSeconds(seconds, &hours_left, &minutes_left, &seconds_left)
{
    hours_left = seconds/60/60;
    minutes_left = (seconds - hours_left*60*60)/60;
    seconds_left = (seconds - hours_left*60*60 - minutes_left*60);
    return 1;
}
Usage example:

pawn Код:
new
    hours,
    minutes,
    seconds;
   
formatSeconds(5000, hours, minutes, seconds);
   
printf("Hours: %d, Minutes: %d, Seconds: %d in 5000 seconds", hours, minutes, seconds);
You should be able to edit that to your needs!
Reply


Messages In This Thread
any way? - by Gh0sT_ - 09.09.2011, 16:09
Re: any way? - by JaTochNietDan - 09.09.2011, 16:35
Re: any way? - by Gh0sT_ - 09.09.2011, 18:33

Forum Jump:


Users browsing this thread: 1 Guest(s)