Anti-Spam System -
TadePoleMG - 04.05.2018
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.
Re: Anti-Spam System -
CrystalGamer - 04.05.2018
PHP код:
new spamming[MAX_PLAYERS][2];
new tick;
new kickplayer[MAX_PLAYERS];
GetTickCount2()
{
new count = GetTickCount();
return count < 0 ? count +- tick : count - tick;
}
PlayerName(playerid)
{
new name[25];
GetPlayerName(playerid, name, sizeof(name));
return name;
}
public OnPlayerText(playerid, text[])
{
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", 50, 0, "dd", playerid, 1);
format(string, 128, "~ %s has been kicked reason spamming.", PlayerName(playerid));
SendClientMessageToAll(-1, string);
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(playerid, kickorban);
public KickOrBan(playerid, kickorban)
{
switch (kickorban)
{
case 1: Kick(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.
Re: Anti-Spam System -
TadePoleMG - 04.05.2018
Thank You
but i'm new here so can you tell me how to rep++.
Re: Anti-Spam System -
CrystalGamer - 04.05.2018
see the pic and click on the star
Re: Anti-Spam System -
CrystalGamer - 04.05.2018
Quote:
Originally Posted by DBZdabIt3Bro7
lol get out of here
|
what do you mean.? huh
Re: Anti-Spam System -
TadePoleMG - 04.05.2018
Stop abusing both guys and thank you CrystalGamer