SA-MP Forums Archive
GetTickCount - 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)
+--- Thread: GetTickCount (/showthread.php?tid=307544)



GetTickCount - BaubaS - 30.12.2011

So, I created anti cmd/text spam using GetTickCount, but seems like it doesnt work. I can spam as much I want.

pawn Код:
if (iTextSpam[playerid] + 2 > GetTickCount() && iTextSpam[playerid] > 0)
{
    return 0;
}
iTextSpam[playerid] = GetTickCount();



Re: GetTickCount - ғαιιοцт - 30.12.2011

GetTickCount returns time in milliseconds, not seconds.

So change it to +2000.


Re: GetTickCount - BaubaS - 30.12.2011

Aah, thanks.. I always mix gettime and GetTickCount returning values


Re: GetTickCount - ғαιιοцт - 30.12.2011

Oh, don't they buth return in milliseconds?
I can only find wat TickCount returns on the wiki, but I do think GetTickCount also returns ime in ms.


Re: GetTickCount - Jefff - 31.12.2011

Use gettime();


Re: GetTickCount - BaubaS - 31.12.2011

Yes, gettime returns in seconds.

@Jefff: AFAIK GetTickCount is better when working with 1-5seconds.