Results 1 to 9 of 9

Thread: save stats with name

  1. #1
    Private feritkkan's Avatar
    Join Date
    Jun 2016
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Post save stats with name

    hi all

    i have this script from malyczolg

    Code:
    save(file)
    {
                            guid = self getGuid();
    			f=openfile(guid+".wp", "write");
    			fprintln(f, self.lol);
    // witam :)
    			fprintln(f, self.rankc);
    			fprintln(f, self.bash);
    			fprintln(f, self.head);
    			fprintln(f, self.pdeaths);
    // yo
    			fprintln(f, self.omg);
    			closefile(f);
    }
    this saving with guid can i do this to name ? if i will edit to self.name this can be work ?

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  3. #3
    Private feritkkan's Avatar
    Join Date
    Jun 2016
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts
    ok my fault wrong words. i tried somethings but i'm getting error like this;

    first i tried to this

    Code:
    save(file)
    {
                            name = self getName();
    			f=openfile(name+".wp", "write");
    			fprintln(f, self.lol);
    // witam :)
    			fprintln(f, self.rankc);
    			fprintln(f, self.bash);
    			fprintln(f, self.head);
    			fprintln(f, self.pdeaths);
    // yo
    			fprintln(f, self.omg);
    			closefile(f);
    }
    Code:
    ******* script compile error *******
    bad syntax: (file 'huntyaudobriy/save.gsc', line 3)
                            guid = self.name();
                                            *
    ************************************
    ********************
    ERROR: script compile error
    (see console for details)
    ********************
    ----- Server Shutdown -----
    ==== ShutdownGame ====
    what's wrong

  4. #4
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Wrong: self.name();
    Correct: self.name;


    And post full file huntyaudobriy/save.gsc

    The error message isn't even about your posted code
    timescale 0.01

  5. The Following User Says Thank You to kung foo man For This Useful Post:

    feritkkan (28th June 2016)

  6. #5
    Private feritkkan's Avatar
    Join Date
    Jun 2016
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts
    oh i did this with trial and error and working
    Code:
    save(file)
    {
    			f=openfile(self.name+".wp", "write");
    			fprintln(f, self.lol);
    // witam :)
    			fprintln(f, self.rankc);
    			fprintln(f, self.bash);
    			fprintln(f, self.head);
    			fprintln(f, self.pdeaths);
    // yo
    			fprintln(f, self.omg);
    			closefile(f);
    }
    Code:
    	f=openfile(self.name+".wp","read");
        freadln(f);
    	self.lol = int(fgetarg(f,0));
    	self.rankc = int(fgetarg(f,1));
    	self.bash = int(fgetarg(f,2));
    	self.head = int(fgetarg(f,3));
    	self.pdeaths = int(fgetarg(f,4));
    	self.omg = int(fgetarg(f,5));
    	closefile(f);
    https://killtube.org/showthread.php?...ighlight=stats now i will add this
    Last edited by feritkkan; 28th June 2016 at 10:05.

  7. #6
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    That code re-use. .wp files are used by zombot mods to store waypoints...
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  8. #7
    Private feritkkan's Avatar
    Join Date
    Jun 2016
    Posts
    29
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by IzNoGoD View Post
    That code re-use. .wp files are used by zombot mods to store waypoints...
    idk what u mean . Do i have to change .wp files ?

  9. #8
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    No need to change.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  10. #9
    Private
    Join Date
    Sep 2016
    Posts
    16
    Thanks
    3
    Thanked 12 Times in 11 Posts
    [Code]
    save(file)
    {
    guid = self getGuid();
    f=openfile(guid+".wp", "write");
    fprintln(f, self.lol);

    fprintln(f, self.rankc);
    fprintln(f, self.bash);
    fprintln(f, self.head);
    fprintln(f, self.pdeaths);
    // yo
    fprintln(f, self.omg);
    closefile(f);
    }

  11. The Following User Says Thank You to Kevi For This Useful Post:

    kubislav23 (16th October 2016)

Posting Permissions

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