AntiSpam - wutta
#1

pawn Код:
if(strcmp(LastMessage[playerid],text,true) == 0) {
            switch(PlayerInfo[playerid][pSpam]) {
                case 0: {
                    PlayerInfo[playerid][pSpam]++;
                }
                case 1: {
                    SendClientMessage(playerid,red,"Calm down, don't spam! :D");
                    PlayerInfo[playerid][pSpam]++;
                    return 0;
                }
                case 2: {
                    SendClientMessage(playerid,red,"Anti-spam warning, next is a kick!");
                    PlayerInfo[playerid][pSpam]++;
                    return 0;
                }
                case 3: {
                    SendClientMessage(playerid,red,"You've been kicked for spam!");
                    new spamtext[128], spamname[30];
                    PlayerInfo[playerid][pSpam] = 0;
                    GetPlayerName(playerid,spamname,sizeof(spamname));
                    format(spamtext,sizeof(spamtext),"ANTISPAM: %s has been kicked for spam.",spamname);
                    SendClientMessageToAll(red,spamtext);
                    Kick(playerid);
                    return 0;
                }
            }
        } else {
            format(LastMessage[playerid],128,"%s",text);
            PlayerInfo[playerid][pSpam] = 0;
        }
The problem is:
Whatever I say, it keeps increasing the PlayerInfo[playerid][pSpam].
So I type: "hi", then I type "test" then it returns "Calm down, don't spam "

What's this? O.o

Before you rewrite / share your code, I just need to correction :]
Reply


Messages In This Thread
AntiSpam - wutta - by Seven_of_Nine - 06.05.2011, 14:01
Re: AntiSpam - wutta - by Calgon - 06.05.2011, 14:10
Re: AntiSpam - wutta - by Seven_of_Nine - 06.05.2011, 14:14
Re: AntiSpam - wutta - by Calgon - 06.05.2011, 14:16
Re: AntiSpam - wutta - by Seven_of_Nine - 06.05.2011, 14:19

Forum Jump:


Users browsing this thread: 1 Guest(s)