wierd error :(
#1

pawn Код:
stock AdvertisementCheck(string[])
{
    if(string[0])
    {
        if(!strfind(string,"www.",false) || !strfind(string,"http://",false)
        || !strfind(string,".com",false) || !strfind(string,".net",false)
        || !strfind(string,".de",false)  || !strfind(string,".org",false)
        || !strfind(string,".info",false || !strfind(string,".tv",false))
        return true;
       
        new c=1,idx,tmp[32],ip[4];
        for(new i=0;i<strlen(string);i++)
        if(string[i]==' ')
        c++;
        for(new i=0;i<c;i++)
        {
            idx=0;
            tmp = L_strtok(string,idx);
            idx=0;
            tmp = L_strtok(tmp,idx,':');
            ip=SplitIP(tmp);
            if(ip[0] && ip[1] && ip[2] && ip[3])
            return true;
        }
    }
    return false;
}
error:
Код:
Current directory: C:\Users\TheFlyer\Desktop\Server\gamemodes
Server.pwn(96) : error 001: expected token: ")", but found "return"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
================ READY ================
plz help me
Reply
#2

Try this

pawn Код:
stock AdvertisementCheck(string[])
{
    if(string[0])
    {
        if(!strfind(string,"www.",false) || !strfind(string,"http://",false)
        || !strfind(string,".com",false) || !strfind(string,".net",false)
        || !strfind(string,".de",false)  || !strfind(string,".org",false)
        || !strfind(string,".info",false || !strfind(string,".tv",false)
        return true;
       
        new c=1,idx,tmp[32],ip[4];
        for(new i=0;i<strlen(string);i++)
        if(string[i]==' ')
        c++;
        for(new i=0;i<c;i++)
        {
            idx=0;
            tmp = L_strtok(string,idx);
            idx=0;
            tmp = L_strtok(tmp,idx,':');
            ip=SplitIP(tmp);
            if(ip[0] && ip[1] && ip[2] && ip[3])
            return true;
        }
    }
    return false;
}
Reply
#3

same error
Reply
#4

pawn Код:
stock AdvertisementCheck(string[])
{
    if(string[0])
    {
        if(!strfind(string,"www.",false) || !strfind(string,"http://",false)
        || !strfind(string,".com",false) || !strfind(string,".net",false)
        || !strfind(string,".de",false)  || !strfind(string,".org",false)
        || !strfind(string,".info",false || !strfind(string,".tv",false)))
        return true;
       
        new c=1,idx,tmp[32],ip[4];
        for(new i=0;i<strlen(string);i++)
        if(string[i]==' ')
        c++;
        for(new i=0;i<c;i++)
        {
            idx=0;
            tmp = L_strtok(string,idx);
            idx=0;
            tmp = L_strtok(tmp,idx,':');
            ip=SplitIP(tmp);
            if(ip[0] && ip[1] && ip[2] && ip[3])
            return true;
        }
    }
    return false;
}
try this
Reply
#5

Thx Error fixed
+REP
Reply
#6

You had yours like this:
pawn Код:
stock AdvertisementCheck(string[])
{
    if(string[0])
    {
        if(!strfind(string,"www.",false) || !strfind(string,"http://",false)
        || !strfind(string,".com",false) || !strfind(string,".net",false)
        || !strfind(string,".de",false)  || !strfind(string,".org",false)
        || !strfind(string,".info",false MISSING BRACKET HERE|| !strfind(string,".tv",false))
        return true;
       
        new c=1,idx,tmp[32],ip[4];
        for(new i=0;i<strlen(string);i++)
        if(string[i]==' ')
        c++;
        for(new i=0;i<c;i++)
        {
            idx=0;
            tmp = L_strtok(string,idx);
            idx=0;
            tmp = L_strtok(tmp,idx,':');
            ip=SplitIP(tmp);
            if(ip[0] && ip[1] && ip[2] && ip[3])
            return true;
        }
    }
    return false;
}
So here's the correct one:
pawn Код:
stock AdvertisementCheck(string[])
{
    if(string[0])
    {
        if(!strfind(string,"www.",false) || !strfind(string,"http://",false)
        || !strfind(string,".com",false) || !strfind(string,".net",false)
        || !strfind(string,".de",false)  || !strfind(string,".org",false)
        || !strfind(string,".info",false) || !strfind(string,".tv",false))
        return true;
       
        new c=1,idx,tmp[32],ip[4];
        for(new i=0;i<strlen(string);i++)
        if(string[i]==' ')
        c++;
        for(new i=0;i<c;i++)
        {
            idx=0;
            tmp = L_strtok(string,idx);
            idx=0;
            tmp = L_strtok(tmp,idx,':');
            ip=SplitIP(tmp);
            if(ip[0] && ip[1] && ip[2] && ip[3])
            return true;
        }
    }
    return false;
}
Reply
#7

Thx aswell xD | +rep
Reply
#8

Quote:
Originally Posted by TheFlyer
Посмотреть сообщение
Thx aswell xD | +rep
I recomend you using my version, because the poster before my one, the brackets aren't closed in the correct place.
Therefor it won't work properly.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)