PDA

View Full Version : save stats with name



feritkkan
28th June 2016, 01:23
hi all

i have this script from malyczolg


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 ?
:confused::confused:

IzNoGoD
28th June 2016, 01:30
https://d.justpo.st/media/images/2014/06/817849a0f171176556a348d956fc3439.jpg

feritkkan
28th June 2016, 09:04
ok my fault wrong words. i tried somethings but i'm getting error like this;

first i tried to this


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);
}


******* 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

kung foo man
28th June 2016, 09:43
Wrong: self.name();
Correct: self.name;


And post full file huntyaudobriy/save.gsc

The error message isn't even about your posted code

feritkkan
28th June 2016, 10:03
oh i did this with trial and error and working
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);
}


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?1981-Save-statsistic-on-name&highlight=stats now i will add this

IzNoGoD
28th June 2016, 10:04
That code re-use. .wp files are used by zombot mods to store waypoints...

feritkkan
28th June 2016, 10:18
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 ?

IzNoGoD
28th June 2016, 10:57
No need to change.

Kevi
16th October 2016, 09:45
[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);
}