PDA

View Full Version : GetTickCount alternative


iTorran
13/06/2012, 06:08 PM
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

JhnzRep
13/06/2012, 06:09 PM
Gettime()

iTorran
13/06/2012, 06:11 PM
Gettime()

Any examples on how I might use that as a replacement for this?

//OnPlayerEnterCheckpoint
Time[playerid] = GetTickCount();

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

SuperViper
13/06/2012, 06:12 PM
Instead of GetTickCount() use tickcount().

iTorran
13/06/2012, 06:14 PM
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

JhnzRep
13/06/2012, 06:16 PM
new Hour, Minute, Second;
gettime(Hour, Minute, Second);
Time[playerid] = gettime();

Time[playerid] = gettime(Hour, Minute, Second) - Time[playerid];[/pawn]