Anti-Spam System
#2

PHP код:
new spamming[MAX_PLAYERS][2];
new 
tick;
new 
kickplayer[MAX_PLAYERS];

GetTickCount2()
{
    new 
count GetTickCount();
    return 
count count +- tick count tick;
}

PlayerName(playerid)
{
 new 
name[25];
 
GetPlayerName(playeridnamesizeof(name));
 return 
name;
}
public 
OnPlayerText(playeridtext[])
{
    new 
count GetTickCount2();
    new 
string[270];
    if (
count-spamming[playerid][1] < 1000) {
        
spamming[playerid][0] ++;
        if (
spamming[playerid][0] == 3) {
            
SendClientMessage(playerid, -1"[Server]: Please dont spam in server.");
        }
        if (
spamming[playerid][0] == 5) {
            
spamming[playerid][0] = 0;
            
SendClientMessage(playerid, -1"~ You have been kicked reason sapmming.");
            
kickplayer[playerid] = SetTimerEx("KickOrBan"500"dd"playerid1);
            
format(string128"~ %s has been kicked reason spamming."PlayerName(playerid));
            
SendClientMessageToAll(-1string);
            
printf("[kicked] %s has been kicked reason spamming."PlayerName(playerid));
            return 
0;
        }
    }
    else
    {
        
spamming[playerid][0] = 1;
    }
    
spamming[playerid][1] = count;
    return 
1;
}

forward KickOrBan(playeridkickorban);
public 
KickOrBan(playeridkickorban)
{
    switch (
kickorban)
    {
        case 
1Kick(playerid);
        case 
2: {
            
Ban(playerid);
        }
    }
    
KillTimer(kickplayer[playerid]);
    
kickplayer[playerid] = 0;

i made this for you well hope it will work.
rep+ if i helped you.
Reply


Messages In This Thread
Anti-Spam System - by TadePoleMG - 04.05.2018, 11:03
Re: Anti-Spam System - by CrystalGamer - 04.05.2018, 11:20
Re: Anti-Spam System - by TadePoleMG - 04.05.2018, 11:22
Re: Anti-Spam System - by CrystalGamer - 04.05.2018, 11:25
Re: Anti-Spam System - by CrystalGamer - 04.05.2018, 11:28
Re: Anti-Spam System - by TadePoleMG - 04.05.2018, 11:29

Forum Jump:


Users browsing this thread: 2 Guest(s)