GetTickCount() Replace function - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: GetTickCount() Replace function (
/showthread.php?tid=255155)
GetTickCount() Replace function -
CrunkBankS - 14.05.2011
What could be replaced function GetTickCount() ?
Quote:
Important Note: GetTickCount will cause problems on servers with uptime of over 24 days (physical server, not SA:MP server) as GetTickCount will eventually warp past the integer size constraints
|
Re: GetTickCount() Replace function -
MadeMan - 14.05.2011
It's not GetTickCount() problem, it's because 2147483647 is the biggest number you can have in PAWN.
(2147483647 is about 24 days in milliseconds)
Re: GetTickCount() Replace function -
Biesmen - 14.05.2011
Quote:
Originally Posted by MadeMan
(2147483647 is about 24 days in milliseconds)
|
It's 27-28 days.
But that's not just the biggest number in PAWN. It's the biggest number for a 32 bit signed integer.
Re: GetTickCount() Replace function -
CrunkBankS - 14.05.2011
Than it can be replaced? I use it for anti-flood
Re: GetTickCount() Replace function -
Skylar Paul - 14.05.2011
Quote:
Originally Posted by CrunkBankS
Than it can be replaced? I use it for anti-flood
|
Just restart your server once every 20 days, and you should be fine.
Re: GetTickCount() Replace function -
CrunkBankS - 14.05.2011
Quote:
Originally Posted by Skylar Paul
Just restart your server once every 20 days, and you should be fine.
|
Re: GetTickCount() Replace function -
CyNiC - 14.05.2011
Tickcount();
Re: GetTickCount() Replace function -
__ - 14.05.2011
@CyNiC - That suffers the same problem.
Use a
Unix timestamp, we shouldn't have problems with these until 2038. (the highest value an integer accepts is 2147483647 which converted to a date as a unix timestamp would be Tue, 19 Jan 2038 03:14:07 GMT according to my timezone)
Re: GetTickCount() Replace function -
Whitetiger - 14.05.2011
use tickcount();
https://sampwiki.blast.hk/wiki/Function:tickcount
edit: I like the reply above me, ignore what i said, do what he said.