SA-MP Forums Archive
way to stop adverting? - 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: way to stop adverting? (/showthread.php?tid=115361)



way to stop adverting? - DiddyBop - 23.12.2009

How do you make it so when anybody says an IP, its automaticly replaced with somthing? but ANY ip.. like

123.22.123.11
93.323.22.111
1.1.1.1
0.0.0.0
666.666.666.666
127.0.0.1
bla.bla.bla.bla ....


Does anybody know how to do this?


Re: way to stop adverting? - mamorunl - 23.12.2009

you could check the sequence of characters (<=3 DOT <=3 DOT <=3 DOT <=3) and check for numbers only.

I guess someone knows how to, this person is not me. Just to help you a little further (even though it is not much)


Re: way to stop adverting? - Striker_Moe - 23.12.2009

Код:
public OnPlayerText(playerid, text[])
{
    if(strfind(text, ".", true) != -1)
    {
	  return 0;
    }
    return 1;
}
Easiest way. Search for Filterscripts instead.


Re: way to stop adverting? - Correlli - 23.12.2009

Quote:
Originally Posted by Mo3
Код:
public OnPlayerText(playerid, text[])
{
    if(strfind(text, ".", true) != -1)
    {
	  return 0;
    }
    return 1;
}
Easiest way. Search for Filterscripts instead.
A very bad way. This will block ANY text with dot in it.


Re: way to stop adverting? - Striker_Moe - 23.12.2009

Thats why I said search for a Filterscript instead. I unfortunately have not got any idea on how to detect IPs.


Re: way to stop adverting? - DiddyBop - 23.12.2009

would this work..

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(strfind(text, "*.*.*.*", true) != -1)
    {
      return 0;
    }
    return 1;
}
?? or would those stars auctually count as stars and not numbers..?


Re: way to stop adverting? - Correlli - 23.12.2009

Quote:
Originally Posted by © HungryPinkPig ©
would this work..

pawn Код:
/* code */
?? or would those stars auctually count as stars and not numbers..?
No, that will block any text with *.*.*.* content.


Re: way to stop adverting? - DiddyBop - 23.12.2009

:\ i know its posible.. crazybobs cnr has it lol


Re: way to stop adverting? - Niixie - 23.12.2009

Or, something like

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(strfind(text, "%d.%d.%d.%d", true) != -1)
    {
      return 0;
    }
    return 1;
}
Donno? the %d works only if theres a
new something


Re: way to stop adverting? - BMUK - 23.12.2009

pawn Код:
public OnPlayerText(playerid, text[])
{
  new dotcount =0;
  new coloncount =0;
  for(new a=1; a <strlen(text); a++)
  {
    if(text[a] == ':')
    {
      coloncount ++;
    }
    else
    if(text[a] == '.')
    {
      dotcount ++;
    }
  }
  if(dotcount == 3 && coloncount == 1)
  {
    // kick?
    return 0;
  }
}
Pretty basic way of doing it