Anti text spam
#5

Try this.

PHP код:
new ChatTime[MAX_PLAYERS],
    
ChatText[MAX_PLAYERS][144];
public 
OnPlayerDisconnect(playeridreason)
{
    
ChatTime[playerid] = 0;
    
format(ChatText[playerid], 144"");
    return 
1;
}
public 
OnPlayerText(playeridtext[])
{
    if((
GetTickCount() - ChatTime[playerid]) < 1000)
    {
        
SendClientMessage(playerid0xFF0000FF"Message has been blocked");
        return 
0;
    }
    if(
strlen(text) == strlen(ChatText[playerid]) && !strcmp(ChatText[playerid], text,  false))
    {
        
SendClientMessage(playerid0xFF0000FF"Your message has been blocked as spam");
        
format(ChatText[playerid], 144"%s"text);
        return 
0;
    }
    
ChatTime[playerid] = GetTickCount();
    
format(ChatText[playerid], 144"%s"text);
    return 
1;

Reply


Messages In This Thread
Anti text spam - by iLearner - 20.08.2016, 14:02
Re: Anti text spam - by Shinja - 20.08.2016, 14:15
Re: Anti text spam - by iLearner - 20.08.2016, 14:44
Re: Anti text spam - by SyS - 20.08.2016, 14:53
Re: Anti text spam - by oMa37 - 20.08.2016, 14:59
Re: Anti text spam - by Affan - 20.08.2016, 15:05
Re: Anti text spam - by Shinja - 20.08.2016, 15:20
Re: Anti text spam - by Jefff - 20.08.2016, 15:21
Re: Anti text spam - by iLearner - 21.08.2016, 10:43
Re: Anti text spam - by Shinja - 21.08.2016, 12:59

Forum Jump:


Users browsing this thread: 2 Guest(s)