Anti IP
#1

Ey, I ain't get it anymore:P
I made this:
Код:
	
             new IPString[128];
	for(new i=0;i<9;i++)
	{
		format(IPString,128,"%d%d%d.%d%d%d.%d%d.%d%d%d:%d%d%d%d",i,i,i,i,i,i,i,i,i,i,i,i,i,i,i);
	
	}
Ofcourse I know it won't work, only if the ip is like 000.000.00.000:0000
But that will never happen :P
I though maybe somebody know how to let this thing detect for every %d the number 0 - 9.
I know there is a way maybe. But I have no idea how :P
Reply
#2

Just use 1 %s for IP?

x Guus jekentmewel
Reply
#3

use GetPlayerIP(..
Reply
#4

pawn Код:
new str[14];
GetPlayerIP(playerid,str,sizeof(str));
Reply
#5

Dude wtf getplayerIP? lol u guys have no idea were I'm talking about.
I'm talking about a anti ip advert fuction.
But I think I already fixed it.
Код:
 
stock CheckPlayerText(playerid,text[])
{
	new IPString[3],ip;
	if(strfind(text,".",true) !=-1 && strfind(text,".",true) !=-1 && strfind(text,".",true) !=-1 && strfind(text,":",true) !=-1)
	for(new i=0;i<9;i++)
	{
		format(IPString,128,"%d",i);
		if(strfind(text,IPString,true) !=- 1) ip++;
	}
	if(ip == 15)
	{
	    SendClientMessage(playerid,Red,"IP detected");
	    return false;
	}
	return true;
}
I see this won't work but i have to change some shit. Didn't test it
Reply
#6

Ok this ain't going to work...
Reply
#7

oops :P.
Reply
#8

Why doesn't delelte the strdel functin the number in the text string?
Код:
  
stock CheckPlayerText(playerid,text[])
{
	new IPString[3],ip;
	new Position;
	if(strfind(text,".",true) !=-1 && strfind(text,".",true) !=-1 && strfind(text,".",true) !=-1 && strfind(text,":",true) !=-1)
	{
		for(new i=0;i<9;i++)
		{
			format(IPString,sizeof(IPString),"%d",i);
			if(strfind(text,IPString,true) != -1)
			{
                Position = strfind(text,IPString,true);
                strdel(text, Position, Position);
				ip++;
				format(pS[String],258,"%d, %s %d",Position,text,strfind(text,IPString,true));
				SendClientMessage(playerid,Red,pS[String]);
			}
		}
	}
	if(ip == 15)
	{
	    SendClientMessage(playerid,Red,"IP detected");
	    return false;
	}
	return true;
}
Or do I have to use strdel(text, Position, Position++); to remove 1 number.
Reply
#9

There are lots of anti-adver functions! Why do you wan't to create another one?
pawn Код:
stock CheckAdv(word[])
{
    if(strlen(word)>22) return 0;
    if(strfind(word,".", true)==-1) return 0;

    new ip[5][256],index;
    ip[0] = strzok(word,index,'.');
    ip[1] = strzok(word,index,'.');
    ip[2] = strzok(word,index,'.');
    if(strfind(word,":",true)>0){
        ip[3] = strzok(word,index,':');
        if(strfind(word,",",true)>0) ip[4] = strzok(word,index,',');else ip[4] = strzok(word,index);
    } else {
        if(strfind(word,",",true)==strlen(word)) ip[3] = strzok(word,index,',');else ip[3] = strzok(word,index);
        valstr(ip[4],0);
    }
    if(!IsNumeric(ip[0])||!IsNumeric(ip[1])||!IsNumeric(ip[2])||!IsNumeric(ip[3])||!IsNumeric(ip[4])
    ||!strlen(ip[0])||!strlen(ip[1])||!strlen(ip[2])||!strlen(ip[3])||!strlen(ip[4])
    ||(strval(ip[0])==192&&strval(ip[1])==168)
    ||(strval(ip[0])==172&&strval(ip[1])>=16&&strval(ip[1])<=31)
    ||strval(ip[0])==10||(strval(ip[0])==127&&strval(ip[1])==0&&strval(ip[2])==0&&strval(ip[3])==1)) return 0;
    return 1;
}
Learn from other codes.
Reply
#10

cause then actually EVERYTHING on his server would be stolenn
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)