16.05.2015, 01:44
Code de todas as Split da include
Sei que por ser uma warning nгo hб problemas, mas quero deixar o meu GM bem identado, se puderem ajudar...
PHP код:
stock TempBanCheck(playerid)
{
new ip[15];
new str[128];
new load[4][32];
new ban_day, ban_month, ban_year, ban_ip[15];
GetPlayerIp(playerid, ip, sizeof ip);
new year, month, day;
getdate(year, month, day);
new File:file = fopen("Temp/TempBans.ban",io_read);
if (file)
{
while (fread(file, str, sizeof str))
{
split(str, load, '|');
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;
}
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("\nERROR: File '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"