[Help] TimeConvert
#1

How to add milliseconds in my TimeConvert?

pawn Код:
TimeConvert(seconds) {
    new
        Str[256];
       
    new minutes = floatround(seconds/60);
    seconds -= minutes*60;
    format(Str, sizeof(Str), "%d:%02d", minutes, seconds);
    return Str;
}
Reply
#2

Try with

PHP код:
stock msToTime(millis, &seconds, &minutes, &hours) {
    
millis /= 1000;
    
hours = millis % 3600;
    
minutes = (millis - hours * 60) % 60;
    
seconds = (millis - hours * 3600 - minutes * 60);
} 
Reply
#3

Quote:
Originally Posted by Squirrel
Посмотреть сообщение
Try with

PHP код:
stock msToTime(millis, &seconds, &minutes, &hours) {
    
millis /= 1000;
    
hours = millis % 3600;
    
minutes = (millis - hours * 60) % 60;
    
seconds = (millis - hours * 3600 - minutes * 60);
} 
example, with an increasing time?
Reply
#4

value in miliseconds / 1000, example:

PHP код:
new seconds = 64132 / 1000;
printf("%d", seconds); 
Reply
#5

I say, with a sample count down..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)