Results 1 to 2 of 2

Thread: Load data from scriptdata files

  1. #1
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts

    Load data from scriptdata files

    Hi all,

    Im trying to get more handy with the fread etc stuff to manage the scriptdata files.
    In Callback_StartGameType()
    Code:
    	level.mostkills =0;
    Then in the endMap()
    Code:
    	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
    Code:
    10
    But it keeps returning level.mostkills = 0

  2. #2
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    fixed. it has to be
    Code:
    10,

  3. The Following User Says Thank You to Ni3ls For This Useful Post:

    kung foo man (22nd March 2013)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •