SA-MP Forums Archive
anti-spam - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: anti-spam (/showthread.php?tid=136997)



anti-spam - Razvann - 27.03.2010

I want to make, when a player types: Hi for 4 times will appear to the admin: x is repeating ( hi ). I don't have any ideas..

I want strict this mode, not if I type: 'Hi' and 'what' and 'are' and 'you' and 'doing', will appear x is repeating ( doing ).

@ Godfather GM.


Re: anti-spam - jamesbond007 - 27.03.2010

Quote:
Originally Posted by Razvann
I want to make, when a player types: Hi for 4 times will appear to the admin: x is repeating ( hi ). I don't have any ideas..

I want strict this mode, not if I type: 'Hi' and 'what' and 'are' and 'you' and 'doing', will appear x is repeating ( doing ).

@ Godfather GM.
make some sense first, second post this in the godfather gm


Re: anti-spam - Razvann - 27.03.2010

Quote:
Originally Posted by jamesbond007
Quote:
Originally Posted by Razvann
I want to make, when a player types: Hi for 4 times will appear to the admin: x is repeating ( hi ). I don't have any ideas..

I want strict this mode, not if I type: 'Hi' and 'what' and 'are' and 'you' and 'doing', will appear x is repeating ( doing ).

@ Godfather GM.
make some sense first, second post this in the godfather gm
Isn't a GF problem..


Re: anti-spam - jamesbond007 - 27.03.2010

Quote:
Originally Posted by Razvann
Quote:
Originally Posted by jamesbond007
Quote:
Originally Posted by Razvann
I want to make, when a player types: Hi for 4 times will appear to the admin: x is repeating ( hi ). I don't have any ideas..

I want strict this mode, not if I type: 'Hi' and 'what' and 'are' and 'you' and 'doing', will appear x is repeating ( doing ).

@ Godfather GM.
make some sense first, second post this in the godfather gm
Isn't a GF problem..
no body will comment you if you dont explain what you want well


Re: anti-spam - Razvann - 27.03.2010

Quote:
Originally Posted by jamesbond007
Quote:
Originally Posted by Razvann
Quote:
Originally Posted by jamesbond007
Quote:
Originally Posted by Razvann
I want to make, when a player types: Hi for 4 times will appear to the admin: x is repeating ( hi ). I don't have any ideas..

I want strict this mode, not if I type: 'Hi' and 'what' and 'are' and 'you' and 'doing', will appear x is repeating ( doing ).

@ Godfather GM.
make some sense first, second post this in the godfather gm
Isn't a GF problem..
no body will comment you if you dont explain what you want well
Ok, if I type for 4 times:
Hi
Hi
Hi
Hi,
will appear to the admins: razvann is repeating ( hi ).


Re: anti-spam - MadeMan - 27.03.2010

pawn Код:
new LastMessage[MAX_PLAYERS][128];
new SpamTimes[MAX_PLAYERS];
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(strcmp(text, LastMessage[playerid]) == 0)
    {
        SpamTimes[playerid]++;
        if(SpamTimes[playerid] >= 3)
        {
            //do your message here
        }
    }
    else
    {
        format(LastMessage[playerid], sizeof(LastMessage[]), text);
        SpamTimes[playerid] = 0;
    }
}



Re: anti-spam - Razvann - 27.03.2010

Quote:
Originally Posted by MadeMan
pawn Код:
new LastMessage[MAX_PLAYERS][128];
new SpamTimes[MAX_PLAYERS];
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(strcmp(text, LastMessage[playerid]) == 0)
    {
        SpamTimes[playerid]++;
        if(SpamTimes[playerid] >= 3)
        {
            //do your message here
        }
    }
    else
    {
        format(LastMessage[playerid], sizeof(LastMessage[]), text);
        SpamTimes[playerid] = 0;
    }
}
If I type:
Hi
What
Are

It sends: razvann is repeating. ( are )..

Want to send only the repeating message, I don't know how to explain very good.


Re: anti-spam - Anwix - 27.03.2010

try changing

pawn Код:
format(LastMessage[playerid], sizeof(LastMessage[]), text);
to

pawn Код:
format(LastMessage[playerid], sizeof(LastMessage[]), "%s", text);



Re: anti-spam - MadeMan - 27.03.2010

Changed the code a bit, should work now.

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(strcmp(text, LastMessage[playerid]) == 0)
    {
        SpamTimes[playerid]++;
        if(SpamTimes[playerid] >= 3)
        {
            //do your message here
        }
    }
    else
    {
        SpamTimes[playerid] = 0;
    }
    format(LastMessage[playerid], sizeof(LastMessage[]), text);
}



Re: anti-spam - ruckfules99 - 27.03.2010

Can someone tell me how i can place this under Onplayercommandtext?


I added it right under onplayercommandtext and my commands are under it and Pawn crashes.