How to make this ?
#9

Already make anti chat spam.
But why did not works ?

PHP код:
public OnPlayerText(playeridtext[])
{
//==============================================================================
// Flood/Spam Protection
//==============================================================================
     
if(ServerInfo[AntiSpam] == && (pInfo[playerid][Admin] == && !IsPlayerAdmin(playerid)))
    {
        if(
pInfo[playerid][SpamCount] == 0pInfo[playerid][SpamTime] = TimeStamp();
        
pInfo[playerid][SpamCount]++;
        if(
TimeStamp() - pInfo[playerid][SpamTime] > SPAM_TIMELIMIT) { // Its OK your messages were far enough apart
            
pInfo[playerid][SpamCount] = 0;
            
pInfo[playerid][SpamTime] = TimeStamp();
        }
        else if(
pInfo[playerid][SpamCount] == SPAM_MAX_MSGS) {
            new 
string[250];
            
format(string,sizeof(string),"{FF0000}|- Player %s (Id:%d) telah otomatis di Kick. | Alasan: Flood/Spam Protection -|"GetName(playerid),playerid);
            if(
GetPVarInt(playerid,"Kick") != 1)
            {
                
SendClientMessageToAll(grey,string);
                
SetPVarInt(playerid,"Kick",1);
            }
            
SaveIn("KickLog",string);
            
pKick(playerid);
        }
        else if(
pInfo[playerid][SpamCount] == SPAM_MAX_MSGS-1)
        {
            
SendClientMessage(playerid,Red,"ATTENTION: Anti Spam! Selanjutnya = Kick!");
            
SMT(playerid,"~r~~h~WARNING: ~w~Stop spam 1x lagi anda chat = kick dari server!");
            return 
0;
        }
    }
    return 
0;

Reply


Messages In This Thread
How to make this ? - by VenomMancer - 24.06.2015, 16:14
Re: How to make this ? - by Hessu - 24.06.2015, 16:18
Re : How to make this ? - by KillerDVX - 24.06.2015, 16:24
Re: How to make this ? - by VenomMancer - 24.06.2015, 16:27
Re : How to make this ? - by KillerDVX - 24.06.2015, 16:31
Re: Re : How to make this ? - by VenomMancer - 24.06.2015, 16:55
Re: How to make this ? - by liquor - 24.06.2015, 17:18
Re: How to make this ? - by Inn0cent - 24.06.2015, 17:27
Re: How to make this ? - by VenomMancer - 24.06.2015, 20:11

Forum Jump:


Users browsing this thread: 1 Guest(s)