[Tutorial] Creating "timer-less" command timers.
#8

Quote:
Originally Posted by iggy1
View Post
Its not safe to use GetTickCount for stuff like this, i know this first hand. It bugs if the server isn't restarted within 24 days. And i don't mean samp server i mean the machine it is running on.

GetTickCount wraps to -2,147,483,647 when it gets past 2,147,483,647.

gettime() is safer to use.

I would advise nobody to use the GetTickCount method.

Kingj servers doesn't always restart within 24 days, that's how i know. One day all commands (that had anti abuse) stopped working, i printed GetTickCount and it was a negative value. Had to switch all code to gettime().

Just saying this in the hopes of saving someone time.
Both ways are fine, everyone should at least restart their server once per week sometimes two but that's when I'm not able to make a update for my server. Anyway, you are right. I'll convert soon.

I use gettickcount for most anti-spamming, gettime for expiration of things.
Reply


Messages In This Thread
Creating "timer-less" command timers. - by warcodes_ - 20.05.2012, 04:10
Re: Creating "timer-less" command timers. - by iggy1 - 20.05.2012, 08:22
Re: Creating "timer-less" command timers. - by Hiddos - 20.05.2012, 09:00
Re: Creating "timer-less" command timers. - by iggy1 - 20.05.2012, 09:15
Re: Creating "timer-less" command timers. - by Hiddos - 20.05.2012, 09:23
Re: Creating "timer-less" command timers. - by warcodes_ - 21.05.2012, 05:21
Re: Creating "timer-less" command timers. - by Niko_boy - 21.05.2012, 05:53
Re: Creating "timer-less" command timers. - by Lorenc_ - 21.05.2012, 06:56
Re: Creating "timer-less" command timers. - by Shadow_ - 21.05.2012, 08:41
Re: Creating "timer-less" command timers. - by warcodes_ - 21.05.2012, 08:52

Forum Jump:


Users browsing this thread: 1 Guest(s)