Quote:
Originally Posted by MP2
Why do you have a foreach loop when you don't do anything with it..?
The best way to make an anti-spam (IMO) is this (without ANY timers):
pawn Код:
new pAntiSpam[MAX_PLAYERS]; // Don't call it this.. public SomeEvent(playerid) { if(gettime()-pAntiSpam[playerid] > 10) // It's been at least 10 seconds since we sent the last message { SendClientMessage(..); pAntiSpam[playerid] = gettime(); } return 1; }
You should use GetTickCount (instead of gettime) if you want an anti-spam that is accurate to the milisecond. gettime() may be up to 0.999999.. seconds off. Not a problem when it's something like 10 seconds.
|
i rly dont understand, it's work on crime? or this is game msg anti spam