[Ajuda] warning "split"
#1

Code de todas as Split da include

PHP код:
stock TempBanCheck(playerid)
{
    new 
ip[15];
    new 
str[128];
    new 
load[4][32];
    new 
ban_dayban_monthban_yearban_ip[15];
    
GetPlayerIp(playeridipsizeof ip);
    new 
yearmonthday;
    
getdate(yearmonthday);
    new 
File:file fopen("Temp/TempBans.ban",io_read);
    if (
file)
    {
        while (
fread(filestrsizeof str))
        {
            
split(strload'|');
            
ban_day strval(load[0]);
            
ban_month strval(load[1]);
            
ban_year strval(load[2]);
            
strmid(ban_ipload[3], 0strlen(load[3])-115);
            if (!(
year >= ban_year && month >= ban_month && day >= ban_day) && !strcmp(ban_ipiptrue))
            {
                
format(strsizeof str"|- You are temporarily banned from this server until: %d/%d/%d -|"ban_dayban_monthban_year);
                
SendClientMessage(playeridREDstr);
                return 
Kick(playerid);
            }
        }
    }
    return 
true;
}
stock LoadCreatedTeles()
{
    if(
fexist(Teles/CreatedTeles.cfg"))
    {
    new File:TPFile = fopen("
Teles/CreatedTeles.cfg", io_read);
    new tpstring[256];
     new Field[6][128];
    new NbTP = 0;
    while(fread(TPFile, tpstring, sizeof(tpstring)))
    {
         if(NbTP >= MAX_CTELES) break;
          if(split(tpstring, Field, ',') == 6)
        {
              strmid(CTeleInfo[NbTP][TName],   Field[0],0,strlen(Field[0]),30);
            CTeleInfo[NbTP][PosX]    = floatstr(Field[1]);
            CTeleInfo[NbTP][PosY]    = floatstr(Field[2]);
            CTeleInfo[NbTP][PosZ]    = floatstr(Field[3]);
            CTeleInfo[NbTP][PosA]    = floatstr(Field[4]);
            CTeleInfo[NbTP][PosInt]    = strlen(Field[5]);
            CTeleInfo[NbTP][TValid]           = 1;
            NbTP++;
            }
        }
    fclose(TPFile);
    print("
\n");
    }
    else printf("
\nERRORFile 'CreatedTeleports' NOT Loaded!\n");
    return 1;
    }
split(const strsrc[], strdest[][], delimiter)
{
    new i, li,aNum,len;
    while(i <= strlen(strsrc))
    {
        if(strsrc[i]==delimiter || i==strlen(strsrc))
        {
            len = strmid(strdest[aNum], strsrc, li, i, 128);
            strdest[aNum][len] = 0;
            li = i+1;
            aNum++;
        }
        i++;
    }
    return aNum;
}
stock SplitIP(ip_string[])
{
    new ip[4],string[16];
    format(string,sizeof(string),ip_string);
    for(new i=0;i<strlen(string);i++)
        if(string[i]=='.')
            string[i]=' ';
    new idx,tmp[32];
    for(new i=0;i<4;i++)
    {
        tmp=L_strtok(string,idx);
        if(tmp[0]=='*')
            ip[i]=-1;
        else
            ip[i]=strval(tmp);
    }
    return ip;

Код:
warning 203: symbol is never used: "split"
Sei que por ser uma warning nгo hб problemas, mas quero deixar o meu GM bem identado, se puderem ajudar...
Reply
#2

Esquisto esse code.

Код:
stock TempBanCheck(playerid) 
{ 
	new
    ip[15], 
    str[128],
    load[4][32],
    ban_ip[15],
    ban_day, 
    ban_month, 
    ban_year,
    year, 
    month, 
    day; 
    getdate(year, month, day); 
    GetPlayerIp(playerid, ip, sizeof ip); 
    new File:file = fopen("Temp/TempBans.ban",io_read); 
    if (file) 
    { 
        while (fread(file, str, sizeof str)) 
        { 
            ban_day = strval(load[0]); 
            ban_month = strval(load[1]); 
            ban_year = strval(load[2]); 
            strmid(ban_ip, load[3], 0, strlen(load[3])-1, 15); 
            if (!(year >= ban_year && month >= ban_month && day >= ban_day) && !strcmp(ban_ip, ip, true)) 
            { 
                format(str, sizeof str, "|- You are temporarily banned from this server until: %d/%d/%d -|", ban_day, ban_month, ban_year); 
                SendClientMessage(playerid, RED, str); 
                return Kick(playerid); 
            } 
        } 
    } 
    return true; 
}
Reply
#3

apenas apaga isto do seu codigo:

PHP код:
split(const strsrc[], strdest[][], delimiter

    new 
ili,aNum,len
    while(
<= strlen(strsrc)) 
    { 
        if(
strsrc[i]==delimiter || i==strlen(strsrc)) 
        { 
            
len strmid(strdest[aNum], strsrclii128); 
            
strdest[aNum][len] = 0
            
li i+1
            
aNum++; 
        } 
        
i++; 
    } 
    return 
aNum

pois nao esta a ser usado em lado algum, apos isso o warning some.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)