stopwatch [ Please need help! ]
#4

Quote:
Originally Posted by Schneider
Посмотреть сообщение
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:
pawn Код:
new StartTick[MAX_PLAYERS];
Then when the countdown is done, and the GoGoGo-text is showing you store the tickcount:
pawn Код:
StartTick[i] = GetTickCount();
When the player reaches the checkpoint you create a new temporarily variable and get the current tick count, then calculate the minutes/seconds/milliseconds:

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);
You don't need that timer (test(playerid))
You are god!! Thx u!!! it working!! THXX!!!!!!!!
Reply


Messages In This Thread
stopwatch [ Please need help! ] - by 7emfic - 23.12.2014, 16:53
Re: stopwatch [ Please need help! ] - by 7emfic - 23.12.2014, 17:52
Re: stopwatch [ Please need help! ] - by Schneider - 23.12.2014, 19:00
Re: stopwatch [ Please need help! ] - by 7emfic - 23.12.2014, 19:54

Forum Jump:


Users browsing this thread: 1 Guest(s)