Anti-Spam System
#1

Hi all

I tried many spam scripts but none help me.

Please help me to making a good anti spam script.

I can show you my script:-

ifPlayerinfo[playerid][Level] == 0)
{
ifPlayerinfo[playerid][SpamCount] == 0) Playerinfo[playerid][SpamTime] = gettime();
Playerinfo[playerid][SpamCount]++;
ifPlayerinfo[playerid][SpamCount] == SPAM_MAX_MSGS)
{
new name[24];
new string[200];
GetPlayerName(playerid,name,24);
format(string,sizeof(string),"%s (%d) has been muted for %d Minutes. Reason: Spam.", name, playerid, AutoUnmuteTime);
SendClientMessageToAll(ADMINCOLOR,string);
SendClientMessage(playerid,red,"* Spam level reached, You have received your final warning (3/3)! Reason: Spam.");
Playerinfo[playerid][Muted] = 1;
SetTimerEx("AutoUnMute",AutoUnmuteTime*60000,false ,"i",playerid);
}
else if(gettime() - Playerinfo[playerid][SpamTime] > SPAM_TIMELIMIT) // All Variables set to 0 if interval of time in player messages is long
{
Playerinfo[playerid][SpamCount] = 0;
Playerinfo[playerid][SpamTime] = gettime();
}
if(gettime() - Playerinfo[playerid][SpamTime] < SPAM_TIMELIMIT)
{
new string[200];
Line 687- format(string,sizeof(string),"* "COL_RED"Warning received (%d/%d)! Reason: Spam.",SpamCount,SPAM_MAX_MSGS);
SendClientMessage(playerid,white,string);
}
return 0;
}

It can't work for me, Help me pls and line 687 give tag mismatch warning how to fix this.

Thank You.
Reply
#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
#3

Thank You but i'm new here so can you tell me how to rep++.
Reply
#4


see the pic and click on the star
Reply
#5

Quote:
Originally Posted by DBZdabIt3Bro7
Посмотреть сообщение
lol get out of here
what do you mean.? huh
Reply
#6

Stop abusing both guys and thank you CrystalGamer
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)