Help regardIng server advertisement - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help regardIng server advertisement (
/showthread.php?tid=412775)
Help regardIng server advertisement -
Desi_Dude - 03.02.2013
Hello I was wondering if there is such code ,like I'll input the IP Address anyone who types that IP would be banned,but the IP wouldn't show in that particular chat..there is a server that is bothering me a lot .they are SAing again and again...
Help would be appreciated
Re: Help regardIng server advertisement -
Gaurav_Rawat - 03.02.2013
hmm Anti-Advertisement ?
PHP Code:
stock AntiAdv(playerid, text[])
{
// Anti Adv
new strR[255], is1=0, r=0;
while(strlen(text[is1]))
{
if('0'<=text[is1]<='9')
{
new is2=is1+1, p=0;
while(p==0)
{
if('0'<=text[is2]<='9'&&strlen(text[is2]))
{
is2++;
}
else
{
strmid(strR[r],text,is1,is2,255);
if(strval(strR[r])<255) r++;
is1=is2;
p=1;
}
}
}
is1++;
}
if(r>=4)
{
new strMy[255];
format(strMy, sizeof(strMy), "AdmWarn: %s is attempting to Server Advertise: %s", playername, text);
SendAdminMessage(COLOR_DARKRED, 1, strMy);
new pr2;
for(new z=0;z<r;z++)
{
while((pr2=strfind(text,strR[z],true))!=-1)
{
for(new i=pr2,j=pr2+strlen(strR[z]);i<j;i++)
{
text[i]='*';
}
}
}
return 1;
}
return 0;
}
If you own stunt server or something
Do this
On callback OnPlayerText
PHP Code:
if(AntiAdv(playerid, params)) return 1;
Or if you have other type of chat just insert that code there