Onplayertext advertise ban -
Mishima - 30.08.2009
well i need help with an anti advertise, i have one that bans people who types certain ips like 80.172.224.244:6666
but if somebody types 80 172 224 244 6666 they will just keep spamming and people just leaves the server,
can somebody helps me?
Re: Onplayertext advertise ban -
LuxurioN™ - 30.08.2009
In
OnPlayerText add:
pawn Код:
new ads;
for(new a, l = strlen(text); a < l; a++)
{
if (text[a] == ':' && d == 3) return ads++;
if(ads == 3) return SendClientMessage(playerid,COLOR_RED,"Not Advertising!");
if (text[a] == '.' && d < 3) d++;
if(ads == 3) return Ban(playerid);
}
return 1;
}
Attention: Not Tested!
Re: Onplayertext advertise ban -
Mishima - 30.08.2009
Quote:
Originally Posted by ► © The LuxurioN™
In OnPlayerText add:
pawn Код:
new ads;
for(new a, l = strlen(text); a < l; a++) { if (text[a] == ':' && d == 3) return ads++; if(ads == 3) return SendClientMessage(playerid,COLOR_RED,"Not Advertising!"); if (text[a] == '.' && d < 3) d++; if(ads == 3) return Ban(playerid); } return 1; }
Attention: Not Tested!
|
thanks, it didn't work, it also made a little warning, undefined simbol "d"
i've put new d;
but didn't work,
Re: Onplayertext advertise ban -
LuxurioN™ - 30.08.2009
pawn Код:
new d;
new ads;
for(new a, l = strlen(text); a < l; a++)
{
if (text[a] == ':' && d == 3) return ads++;
if(ads == 3) return Ban(playerid);
if (text[a] == '.' && d < 3) d++;
if(d == 3) return Ban(playerid);
}
return 1;
}
Not tested!
Re: Onplayertext advertise ban -
Mishima - 31.08.2009
Quote:
Originally Posted by ► © The LuxurioN™
pawn Код:
new d; new ads; for(new a, l = strlen(text); a < l; a++) { if (text[a] == ':' && d == 3) return ads++; if(ads == 3) return Ban(playerid); if (text[a] == '.' && d < 3) d++; if(d == 3) return Ban(playerid); } return 1; }
Not tested!
|
just a question will this ban people that use ips like this 80 172 224 244 6666
:S
Re: Onplayertext advertise ban -
Mishima - 31.08.2009
sorry the damn double post... but this doesn't work
Re: Onplayertext advertise ban -
Mishima - 31.08.2009
those damn gays
but just they keep on coming, like "hey this server sucks, join 192.... " i ban them and they just keep changing their ip ...
Seif_ do you know then a way to block ip advertisement with pontuation, by pm? i only have cmd and OnPlayertext blocked :\
Re: Onplayertext advertise ban -
Stefan_Toretto - 18.08.2010
Try to put this on every command
Код:
if(FindIP(text))
{
new advertiser[MAX_PLAYER_NAME];
GetPlayerName(playerid, advertiser, sizeof(advertiser));
format(string, sizeof(string), "AdmCmd: %s was warned & kicked by AdmBOT, reason: Server Advertising",advertiser);
SendClientMessageToAll(COLOR_LIGHTRED,string);
KickLog(string);
PlayerInfo[playerid][pWarns] += 1;
Kick(playerid);
return 1;
}
and this as an public
Код:
FindIP(StrToChk[])
{
new IpLevel = 0;
for(new a = 0; a < strlen(StrToChk); a++)
{
switch(IpLevel)
{
case 0:
{
if(IsNum(StrToChk[a])) IpLevel++;
}
case 1, 2:
{
if(IsNum(StrToChk[a])) IpLevel++;
else if(StrToChk[a] == '.') IpLevel = 4;
else IpLevel = 0;
}
case 3:
{
if(StrToChk[a] == '.') IpLevel++;
else IpLevel = 0;
}
case 4:
{
if(IsNum(StrToChk[a])) IpLevel++;
else IpLevel = 0;
}
case 5, 6:
{
if(IsNum(StrToChk[a])) IpLevel++;
else if(StrToChk[a] == '.') IpLevel = 8;
else IpLevel = 0;
}
case 7:
{
if(StrToChk[a] == '.') IpLevel++;
else IpLevel = 0;
}
case 8:
{
if(IsNum(StrToChk[a])) IpLevel++;
else IpLevel = 0;
}
case 9, 10:{
if(IsNum(StrToChk[a])) IpLevel++;
else if(StrToChk[a] == '.') IpLevel = 12;
else IpLevel = 0;
}
case 11:
{
if(StrToChk[a] == '.') IpLevel++;
else IpLevel = 0;
}
case 12:
{
if(IsNum(StrToChk[a])) return 1;
else IpLevel = 0;
}
}
}
return 0;
}
Re: Onplayertext advertise ban -
Stefan_Toretto - 18.08.2010
Quote:
Originally Posted by heber
In OnPlayerText add:
pawn Код:
new ads;
for(new a, l = strlen(text); a < l; a++) { if (text[a] == ':' && d == 3) return ads++; if(ads == 3) return SendClientMessage(playerid,COLOR_RED,"Not Advertising!"); if (text[a] == '.' && d < 3) d++; if(ads == 3) return Ban(playerid); } return 1; }
Attention: Not Tested!
|
This shit doesn't works...
Re: Onplayertext advertise ban -
Retardedwolf - 18.08.2010
Junkbuster has one.
Check the script and stop calling the scripts shit, people try to make it for you and you cant do any better.