Code:
if(fid==0)
{
argcount=fReadLn(fid);
linenum=0;
while(argcount>0)
{
if(linenum>0 && argcount==2)
if(guid==int(fGetArg(fid,0)))
self.money=int(fGetArg(fid,1));
argcount=fReadLn(fid);
linenum++;
}
}
else
self.money=startMoney;
Please replace the first check with a check for -1 instead of 0. So, if(fid != -1)
Also, this looks like the reading file function is ripped DIRECTLY out of my account system:
Code:
//MY code.
argcount=freadln(fid);
linenum=0;
self.stats=[];
while(argcount!=0)
{
if(linenum>0)
self.stats[fgetarg(fid,0)]=int(fgetarg(fid,1));
argcount=freadln(fid);
linenum++;
}
No worries, please just add credits and it will be fine.