24.05.2013, 00:04
Let me search my script for the one i've got I'll modify it for you so it bans(hopefully)
Edit
Let me know if it's ok for what you need
Edit
pawn Код:
#define TIME_BETWEEN_MESSAGES 3 //thats 3 seconds between each message.
#define MAX_SPAM_WARNS 3 //thats 3 spam warnings too
new LastSpoke[MAX_PLAYERS],SpamWarns[MAX_PLAYERS];
public OnPlayerText(playerid,inputtext[])
{
if(LastSpoke[playerid] > gettime())
{
new string[128];
SpamWarns[playerid] ++;
if(SpamWarns[playerid] >= MAX_SPAM_WARNS)
{
format(string,sizeof(string),"%s has been banned for spamming",PlayerName);
SendClientMessageToAll(-1,string);
Ban(playerid);
}
else
{
SendClientMessage(playerid,-1,"You can't talk for "#TIME_BETWEEN_MESSAGES" seconds.");
SendClientMessage(playerid,-1,"Do not repeat yourself.");
}
return 0;
}
LastSpoke[playerid] = gettime() + TIME_BETWEEN_MESSAGES;
return 1;
}