#1

Hi!How would I make a "finished race in xxx time" kind of system?I couldn't find any useful filterscripts.So,yeah.Thank you if would be kind enough to help me
Reply
#2

Look at GetTickCount() and/or gettime(hour, min, sec)
Reply
#3

GetTickCount would be your best option, this can be used something like below:

pawn Код:
new RaceStart = GetTickCount();
So save that one somewhere, then to calculate the time:

pawn Код:
new TimeTaken = (GetTickCount() - RaceStart);
new TakenSeconds = (TimeTaken * 1000);
new TakenMinutes = ((TimeTaken * 1000) / 60);
GetTickCount gets the time the server was up, and counts up 1000 give or take every second the server is up (accuracy isn't its strength).

We get the tickcount when they start the race, and we get it again when they finish, we take the first away from the second to get the time difference to calculate it.

A word of warning however, I seem to remember that this overlaps the maximum variable size there is a workaround what it is however I do not remember and cannot find reference to it anywhere.

EDIT: I found the solution to the problem look here:

https://gist.github.com/ziggi/5d7d8d...a7ae924c608e73

Useage changes one line:
pawn Код:
new TimeTaken = GetTickDiff(GetTickCount(), RaceStart);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)