06.05.2011, 14:01
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;
}
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 :]