anti-spam
#1

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.
Reply
#2

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
Reply
#3

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..
Reply
#4

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
Reply
#5

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 ).
Reply
#6

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;
    }
}
Reply
#7

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.
Reply
#8

try changing

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

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

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);
}
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)