Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
I need to show a racer's laptime when they finish a race, and some races can be several minutes long so I need something like
'1 minute, 2.55 seconds'
Thanks in advance.
Posts: 65
Threads: 3
Joined: Jan 2011
Reputation:
0
You just need a timer for this like:
//At the top of your script
new sec,min,hour,time;
forward Counter();
main()
{
time = SetTimer("Counter",1000,1);
}
public Counter()
{
sec ++;
if(sec == 60) { sec=0; min++; }
if(min == 60) { min=0; h++; }
return 1;
}
/*
and if the player ends the race you just need to kill the timer like this: KillTimer(time);
*/
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
I need miliseconds. Don't suggest using a timer please, I don't want that.
Posts: 43
Threads: 5
Joined: Aug 2009
Reputation:
0
GetTickCount() will do the job without using a timer set to 1 millisecond lol.