GetTickCount
#1

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();
Reply
#2

GetTickCount returns time in milliseconds, not seconds.

So change it to +2000.
Reply
#3

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

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

Use gettime();
Reply
#6

Yes, gettime returns in seconds.

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


Forum Jump:


Users browsing this thread: 1 Guest(s)