way to stop adverting?
#1

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?
Reply
#2

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)
Reply
#3

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

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.
Reply
#5

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

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..?
Reply
#7

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.
Reply
#8

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

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
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)