Banning Spammers
#2

Let me search my script for the one i've got I'll modify it for you so it bans(hopefully)

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;
}
Let me know if it's ok for what you need
Reply


Messages In This Thread
Banning Spammers - by Geeboi_Mehdi - 23.05.2013, 23:32
Re: Banning Spammers - by DobbysGamertag - 24.05.2013, 00:04
Re: Banning Spammers - by Geeboi_Mehdi - 24.05.2013, 00:17

Forum Jump:


Users browsing this thread: 3 Guest(s)