spamming
#3

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
Reply


Messages In This Thread
spamming - by pelani - 11.02.2013, 23:17
Re: spamming - by MP2 - 11.02.2013, 23:52
Re: spamming - by pelani - 12.02.2013, 08:43

Forum Jump:


Users browsing this thread: 2 Guest(s)