23.12.2014, 19:00
You can create a new variable at the top of the script for each player which stores the tickcount at the moment the player starts racing:
Then when the countdown is done, and the GoGoGo-text is showing you store the tickcount:
When the player reaches the checkpoint you create a new temporarily variable and get the current tick count, then calculate the minutes/seconds/milliseconds:
You don't need that timer (test(playerid))
pawn Код:
new StartTick[MAX_PLAYERS];
pawn Код:
StartTick[i] = GetTickCount();
pawn Код:
//OnPlayerEnterRaceCheckpoint
new RaceTime = (GetTickCount() - StartTick[playerid]);
new str[128];
format(str, 128, "You finished in %02d:%02d.%03d", RaceTime/60000, (RaceTime%60000)/1000, (RaceTime%1000));
SendClientMessage(playerid, -1, str);