Help Downgrade This Code Please
#2

Top of your script:
pawn Код:
new SpamProtection[MAX_PLAYERS];
OnPlayerConnect:
pawn Код:
SpamProtection[playerid] = 0;
At every weapon command:
pawn Код:
SpamProtection++;
if(SpamProtection == 3) return // ----> (SetTimerEx here, or what ever you want)

-----------
If you want it my way:

OnGameModeInit:
pawn Код:
SetTimer("NoSpam",20000,1);
Somewhere down your script:
pawn Код:
forward NoSpam();

public NoSpam()
{
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
       
            if(SpamProtection[i] > 0)
            {
                SpamProtection[i] = 0;
            }
           
        }
    }
}
At every weapon command:
pawn Код:
SpamProtection++;
if(SpamProtection == 3) return SendClientMessage(playerid, COLOR_GREEN, "SERVER: Hey, wait a few seconds, spammy boi C:");

------------
For the weapon thingy, if you want to make it smaller, use dialogs or strtok/tmp .
Reply


Messages In This Thread
Help Downgrade This Code Please - by <Weponz> - 25.10.2010, 11:46
Re: Help Downgrade This Code Please - by rbN. - 25.10.2010, 11:49
Re: Help Downgrade This Code Please - by <Weponz> - 25.10.2010, 11:59
Re: Help Downgrade This Code Please - by Calgon - 25.10.2010, 12:01
Re: Help Downgrade This Code Please - by rbN. - 25.10.2010, 12:19
Re: Help Downgrade This Code Please - by <Weponz> - 25.10.2010, 12:31

Forum Jump:


Users browsing this thread: 2 Guest(s)