Quote:
Originally Posted by RobinOwnz
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 .
|
Dude this is Spam Protection...I want my** code in one and a timer for it so thay can only get a weapon every 2 mins..