16.04.2011, 15:20
hi,
I wanted to create a race time counter for my racing script (yrace, edit'd it for my script). But, it doesn't count the time exactly. Here're the codes:
The timer is;
The timer starts counting after race start countdown (3, 2, 1, and it starts with "GO!"). But when i finished the race, it doesn't give the time exactly. Can you see anything wrong here?
I wanted to create a race time counter for my racing script (yrace, edit'd it for my script). But, it doesn't count the time exactly. Here're the codes:
Code:
. . . { format(ystring, sizeof(ystring), "~g~GO!",cd); RaceMiliSeconds = 0; RaceSeconds = 0; RaceMinutes = 0; RaceTimer = SetTimer( "RaceTimex", 10, 1); . . .
Code:
public RaceTimex() { RaceMiliSeconds++; if(RaceMiliSeconds == 100) //counts miliseconds, 100 milisecs = 1 sec { RaceSeconds++; RaceMiliSeconds = 0; } if(RaceSeconds == 60) //counts seconds, 60 secs = 1 min { RaceMinutes++; RaceSeconds = 0; } }