PDA

View Full Version : Load data from scriptdata files



Ni3ls
22nd March 2013, 15:17
Hi all,

Im trying to get more handy with the fread etc stuff to manage the scriptdata files.
In Callback_StartGameType()

level.mostkills =0;

Then in the endMap()

f=openfile("stats/bestplayers.txt","read");
if(f !=-1)
{
freadln(f);
level.mostkills = int(fgetarg(f,0));
iprintlnbold("Most kills: "+level.mostkills);
closefile(f);
}

and i made bestplayers.txt in scriptdata/stats and inside this file

10

But it keeps returning level.mostkills = 0

Ni3ls
22nd March 2013, 22:44
fixed. it has to be
10,