Anti server advertise - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Anti server advertise (
/showthread.php?tid=224802)
Anti server advertise -
darkknight123 - 12.02.2011
How would I create a anti server advertisment FS like when a player says 197.123.456:7777 itll turn it into ***.***.***:7777 or something simular?
Re: Anti server advertise -
Stigg - 12.02.2011
You Counld try something like:
public OnPlayerText(playerid)
{
new ip[4];
if(ipmatch(text, ip))
{
SendClientMessage(playerid, RED, "Your warn message here");
return 0;
}
return 1;
}
Peace...
Re: Anti server advertise -
HyperZ - 12.02.2011
OnPlayerText:
pawn Код:
new str[256];
new is1 = 0;
new r = 0;
while(strlen(text[is1]))
{
if('0'<=text[is1]<='9')
{
new is2=is1+1;
new p=0;
while(p==0)
{
if('0'<=text[is2]<='9'&&strlen(text[is2])) is2++;
else
{
strmid(str[r],text,is1,is2,255);
if(strval(str[r])<255) r++;
is1 = is2;
p = 1;
}
}
}
is1++;
}
if(r>=4)
{
for(new z=0;z<r;z++)
{
new pr2;
while((pr2=strfind(text,str[z],true))!=-1) for(new i=pr2,j=pr2+strlen(str[z]);i<j;i++) text[i]='*';
}
}
Re: Anti server advertise -
Stigg - 12.02.2011
Quote:
Originally Posted by Clive
OnPlayerText:
pawn Код:
new str[256]; new is1 = 0; new r = 0; while(strlen(text[is1])) { if('0'<=text[is1]<='9') { new is2=is1+1; new p=0; while(p==0) { if('0'<=text[is2]<='9'&&strlen(text[is2])) is2++; else { strmid(str[r],text,is1,is2,255); if(strval(str[r])<255) r++; is1 = is2; p = 1; } } } is1++; } if(r>=4) { for(new z=0;z<r;z++) { new pr2; while((pr2=strfind(text,str[z],true))!=-1) for(new i=pr2,j=pr2+strlen(str[z]);i<j;i++) text[i]='*'; } }
|
Nice. Clive's the Man.
Peace...
Re: Anti server advertise -
darkknight123 - 12.02.2011
Thanks Clave works nicely
i give you a 100/10 lol
Re: Anti server advertise -
HyperZ - 12.02.2011
Quote:
Originally Posted by darkknight123
Thanks Clave works nicely
i give you a 100/10 lol
|
Lol, No Problem.
Re: Anti server advertise -
darkknight123 - 14.02.2011
Also how would i add this to /r and /o and stuff like that? thanks
Re: Anti server advertise -
cessil - 14.02.2011
put it in a stock that converts the text, also why is there a 256 size string?
Re: Anti server advertise -
darkknight123 - 14.02.2011
How would I do that?