Hello, can someone explain me why it always writes the same line in the file when I connect back? It shouldn't write after I am already registered in the file. It seems it doesn't execute ''if(equal(steamid,parsedsteamid))'' this line in the code because it always creates a new line in the file with the same SSID.
PS: Also would be glad if anyone tell me how to update my line after writing something there.
PHP Code:
new fsize = file_size(filename,1);
for (new line=0;line<=fsize;line++)
{
read_file(filename,line,readdata,127,txtlen);
parse(readdata,parsedsteamid,31, parsedCompletedFiveKills, 31);
get_user_authid(id,steamid,31);
if(equal(steamid,parsedsteamid))
{
hasCompletedKills[id] = parsedCompletedFiveKills;
break;
}
else if(!equal(steamid,parsedsteamid))
{
new writedata[128];
new steamid[32], bool:completedFiveKills;
get_user_authid(id,steamid,31);
completedFiveKills = false;
formatex(writedata,127,"%s %d",steamid, completedFiveKills)
write_file(filename,writedata);
break;
}
}