GetTickCount alternative
#1

Is there any GetTickCount alternative?
I script event gamemodes for this server, and I use GetTickCount to get the time between 2 points..
But, I dont like the fact that the server must be restarted every 24 days.. So is there any alternatives?
Possibly something that starts on SA-MP server startup rather than physical server
Reply
#2

Gettime()
Reply
#3

Quote:
Originally Posted by JhnzRep
Посмотреть сообщение
Gettime()
Any examples on how I might use that as a replacement for this?

pawn Код:
//OnPlayerEnterCheckpoint
Time[playerid] = GetTickCount();

//OnPlayerEnterRaceCheckpoint
Time[playerid] = GetTickCount() - Time[playerid];
printf("Time was %i", Time[playerid]);
Reply
#4

Instead of GetTickCount() use tickcount().
Reply
#5

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
Instead of GetTickCount() use tickcount().
I'd heard of that, I even saw it on wiki..
But when trying "Tickcount()" I got errors..
Which ofc I know why now.. since its tickcount not Tickcount

I'll try that, thanks
Reply
#6

pawn Код:
new Hour, Minute, Second;
gettime(Hour, Minute, Second);
Time[playerid] = gettime();
Time[playerid] = gettime(Hour, Minute, Second) - Time[playerid];[/pawn]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)