25.10.2010, 11:49
Top of your script:
OnPlayerConnect:
At every weapon command:
-----------
If you want it my way:
OnGameModeInit:
Somewhere down your script:
At every weapon command:
------------
For the weapon thingy, if you want to make it smaller, use dialogs or strtok/tmp .
pawn Код:
new SpamProtection[MAX_PLAYERS];
pawn Код:
SpamProtection[playerid] = 0;
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);
pawn Код:
forward NoSpam();
public NoSpam()
{
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
if(SpamProtection[i] > 0)
{
SpamProtection[i] = 0;
}
}
}
}
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 .