GetTickCount() Replace function
#1

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

Reply
#2

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)
Reply
#3

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.
Reply
#4

Than it can be replaced? I use it for anti-flood
Reply
#5

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.
Reply
#6

Quote:
Originally Posted by Skylar Paul
Посмотреть сообщение
Just restart your server once every 20 days, and you should be fine.
Reply
#7

Tickcount();
Reply
#8

@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)
Reply
#9

use tickcount(); https://sampwiki.blast.hk/wiki/Function:tickcount

edit: I like the reply above me, ignore what i said, do what he said.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)