Need help with Chatbox [ READ Please!! ]
#1

ok,so i got a chatbot.


from. here.
http://pastebin.com/M4BQDt7k


When i say something like...

hi , bot replies but when i say like 5 times hi, then he says 5 times the message..
so it can be abused with spam...



Can anyone edit that pastebin or tell me how to make it like this:

Example i say 5 times hi and she replys only after maybe 20 sec ?
Reply
#2

any1?
Reply
#3

Try this:

pawn Код:
new p_AntiSpam[ MAX_PLAYERS ];
public OnPlayerText(playerid, text[])
{
    if( ( ( GetTickCount( ) - p_AntiSpam[ playerid ] ) > 20000 )
    {
        if(!strcmp(text, "Ha", true) || !strcmp(text, "lol", true) || !strcmp(text, "rofl", true) || !strcmp(text, "lmao", true))
        {
            SendPlayerMessageToAll(playerid, text);
            SendBotMessage("ROFL - COPTER");
            p_AntiSpam[ playerid ] = GetTickCount( );
            return 0;
        }

        if(!strcmp(text, "Hi", true) || !strcmp(text, "Sup", true) || !strcmp(text, "Sophie", true) || !strcmp(text, "Hiya", true))
        {
            SendPlayerMessageToAll(playerid, text);
            Random(playerid);
            p_AntiSpam[ playerid ] = GetTickCount( );
            return 0;
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)