SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 13/06/2012, 06:08 PM   #1
iTorran
Gangsta
 
Join Date: Aug 2010
Posts: 543
Reputation: 88
Default GetTickCount alternative

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
iTorran is offline   Reply With Quote
Old 13/06/2012, 06:09 PM   #2
JhnzRep
Huge Clucker
 
JhnzRep's Avatar
 
Join Date: Jan 2012
Location: USA/Slovakia
Posts: 462
Reputation: 65
Default Re: GetTickCount alternative

Gettime()
__________________
[center]Creations:

[Tutorial]
Business System
JhnzRep is offline   Reply With Quote
Old 13/06/2012, 06:11 PM   #3
iTorran
Gangsta
 
Join Date: Aug 2010
Posts: 543
Reputation: 88
Default Re: GetTickCount alternative

Quote:
Originally Posted by JhnzRep View Post
Gettime()
Any examples on how I might use that as a replacement for this?

pawn Code:
//OnPlayerEnterCheckpoint
Time[playerid] = GetTickCount();

//OnPlayerEnterRaceCheckpoint
Time[playerid] = GetTickCount() - Time[playerid];
printf("Time was %i", Time[playerid]);
iTorran is offline   Reply With Quote
Old 13/06/2012, 06:12 PM   #4
SuperViper
High-roller
 
SuperViper's Avatar
 
Join Date: Sep 2011
Posts: 1,178
Reputation: 315
Default Re: GetTickCount alternative

Instead of GetTickCount() use tickcount().
__________________
Release NameUse
FairPlayKeep the cheaters out of your server
Object Model ArrayArray of every single object model in the game
RCON PanelControl any server as you like with RCON controls
SlopeClimb up a steep hill against other players with cars falling down

I do not play on any SAMP server. Anyone with the name Ricky Phelps in-game is an imposter.
SuperViper is offline   Reply With Quote
Old 13/06/2012, 06:14 PM   #5
iTorran
Gangsta
 
Join Date: Aug 2010
Posts: 543
Reputation: 88
Default Re: GetTickCount alternative

Quote:
Originally Posted by SuperViper View Post
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
iTorran is offline   Reply With Quote
Old 13/06/2012, 06:16 PM   #6
JhnzRep
Huge Clucker
 
JhnzRep's Avatar
 
Join Date: Jan 2012
Location: USA/Slovakia
Posts: 462
Reputation: 65
Default Re: GetTickCount alternative

pawn Code:
new Hour, Minute, Second;
gettime(Hour, Minute, Second);
Time[playerid] = gettime();

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

[Tutorial]
Business System
JhnzRep is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Help]GetTickCount. moadi Scripting Help 1 27/10/2011 03:52 PM
Help me with GetTickCount() [00]Luis Scripting Help 5 04/09/2011 04:38 PM
GetTickCount in C++ -Davee- Help Archive 3 26/10/2010 03:41 PM
GetTickCount [CripZ]SERCH Русский/Russian 16 19/10/2010 08:40 PM
GetTickCount Agent Smith Help Archive 7 23/07/2010 01:01 AM


All times are GMT. The time now is 10:28 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.