[HELP]Anti-IP advertising
#1

I need FS that will block typing IP adress into /ad, /b, /ooc, /pm, /n, /a and normal chat...can somebody please help me with this
(sorry if my english is bad)
Reply
#2

pawn Код:
f(strfind("Everyone come to ...", "82.77", true) != -1) //returns 4 (!= -1 because -1 would be 'not found')
{
    Kick(playerid);
}
If this is what youve been searching
Reply
#3

To traži 82.77 u tekstu,a šta ako je ip npr. 90.67?

That is working in case that the ip is 82.77 but what if it is different?

Pozdrav
Reply
#4

Quote:
Originally Posted by SkizzoTrick
Посмотреть сообщение
pawn Код:
f(strfind("Everyone come to ...", "82.77", true) != -1) //returns 4 (!= -1 because -1 would be 'not found')
{
    Kick(playerid);
}
If this is what youve been searching
no...i want to block/hide IP adress that are entered in /ad, /b, /ooc, /pm, /n, /a and normal chat...i know how to hide IP adress that are placed in normal chat but I need to edit my GM and i dont know how to do this on other chats.....and i wont it to be FS so i don't need to edit my GM

Код:
	new brojevi[] = { '1','2','3','4','5','6','7','8','9'};
				for(new b = 0; b < sizeof brojevi; b++)
			{
				new tekst = strlen(text);
				for(new i = 0; i<tekst; i++)
					{
					if(text[i] == brojevi[b])
					text[i] = '*' ;
					}
			}
it looks like this when i edit my GM to hide IP numbers that are entered in normal chat...it replaces the numbers with stars

(sorry if my english is bad)
Reply
#5

Quote:
Originally Posted by Nenad
Посмотреть сообщение
no...i want to block/hide IP adress that are entered in /ad, /b, /ooc, /pm, /n, /a and normal chat...i know how to hide IP adress that are placed in normal chat but I need to edit my GM and i dont know how to do this on other chats.....and i wont it to be FS so i don't need to edit my GM

Код:
	new brojevi[] = { '1','2','3','4','5','6','7','8','9'};
				for(new b = 0; b < sizeof brojevi; b++)
			{
				new tekst = strlen(text);
				for(new i = 0; i<tekst; i++)
					{
					if(text[i] == brojevi[b])
					text[i] = '*' ;
					}
			}
it looks like this when i edit my GM to hide IP numbers that are entered in normal chat...it replaces the numbers with stars

(sorry if my english is bad)
Wow,you putted there something that hides all the numbers?)i don't think that that's the best thing you can do
Better try this:
pawn Код:
public OnPlayerText(...)
{
if(strfind("Everyone come to ...", "82.77", true) != -1) //returns 4 (!= -1 because -1 would be 'not found')
{
    //Put here the punish
}
else if(strfind("Giving admin at", "192.77", true) != -1) //returns 4 (!= -1 because -1 would be 'not found')
{
    //Put here the punish
}
Reply
#6

Quote:
Originally Posted by SkizzoTrick
Посмотреть сообщение
Wow,you putted there something that hides all the numbers?)i don't think that that's the best thing you can do
Better try this:
pawn Код:
public OnPlayerText(...)
{
if(strfind("Everyone come to ...", "82.77", true) != -1) //returns 4 (!= -1 because -1 would be 'not found')
{
    //Put here the punish
}
else if(strfind("Giving admin at", "192.77", true) != -1) //returns 4 (!= -1 because -1 would be 'not found')
{
    //Put here the punish
}
no...i like it my way...because i dont want people to put numbers in chat anyway xD that is why i need to hide/block numbers typed in all chats and i dont know how to do it

(sorry if my english is bad)
Reply
#7

Quote:
Originally Posted by SkizzoTrick
Посмотреть сообщение
Text
I'm sorry, but that is just incredibly dumb. Are you gonna edit your script every time someone shouts out a new ip in the chat?

pawn Код:
public OnPlayerText(playerid, text[])
{
    new
        result[128] = text;

    for(new i = 0, j = strlen(result); i < j; i++)
    {
        if('0' <= result[i] <= '9')
        {
            result[i] = '*';
        }
    }

    SendPlayerMessageToAll(playerid, result);
    return 0;
}
This will filter out ANY numbers typed into the chat box.

Edit: result has to be a string as well, my bad.
Reply
#8

Quote:
Originally Posted by Vince
Посмотреть сообщение
I'm sorry, but that is just incredibly dumb. Are you gonna edit your script every time someone shouts out a new ip in the chat?

pawn Код:
public OnPlayerText(playerid, text[])
{
    new
        result = text;

    for(new i = 0, j = strlen(result); i < j; i++)
    {
        if('0' <= result[i] <= '9')
        {
            result[i] = '*';
        }
    }

    SendPlayerMessageToAll(playerid, result);
    return 0;
}
This will filter out ANY numbers typed into the chat box.
That's extremely smart and extremely good.
Reply
#9

Quote:
Originally Posted by Vince
Посмотреть сообщение
I'm sorry, but that is just incredibly dumb. Are you gonna edit your script every time someone shouts out a new ip in the chat?

-epic code-

This will filter out ANY numbers typed into the chat box.
That's awesome!
Reply
#10

Quote:
Originally Posted by Vince
Посмотреть сообщение
I'm sorry, but that is just incredibly dumb. Are you gonna edit your script every time someone shouts out a new ip in the chat?

pawn Код:
public OnPlayerText(playerid, text[])
{
    new
        result = text;

    for(new i = 0, j = strlen(result); i < j; i++)
    {
        if('0' <= result[i] <= '9')
        {
            result[i] = '*';
        }
    }

    SendPlayerMessageToAll(playerid, result);
    return 0;
}
This will filter out ANY numbers typed into the chat box.
it gives me 26 errors and 2 warrnings when i put this code into my GM xDD
can u please make FS like this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)