-
save script error
hi , i test my mod on developer 1 and :
Code:
******* script runtime error *******
struct is not an entity: (file 'huntyaudobriy/save.gsc', line 3)
guid = self getGuid();
*
called from:
(file 'huntyaudobriy/dmk.gsc', line 105)
thread huntyaudobriy\save::save(level.wpfile);
*
called from:
(file 'maps/mp/gametypes/_callbacksetup.gsc', line 15)
[[level.callbackStartGameType]]();
*
started from:
(file 'maps/mp/gametypes/_callbacksetup.gsc', line 10)
CodeCallback_StartGameType()
*
************************************
but if server on developer 0 mod work , whocan help me ?
save script :
PHP Code:
save(file)
{
guid = self getGuid();
f=openfile(guid+".txt", "write");
fprintln(f, self.lol);
fprintln(f, self.rankc);
closefile(f);
}
-
You need to call that function with "self", like this: self thread huntyaudobriy\save::save(level.wpfile);
-
-
Then youll still be trying to get the guid of the server, not of the client. Call it on a proper player instead of on level.
-
******* script runtime error *******
pair 'undefined' and '.wp' has unmatching types 'undefined' and 'string': (file 'rankmod/dmk.gsc', line 1023)
f=openfile(guid+".wp", "write");
help plz
-
why not call it simply .txt ?
-
-
Why do you still assume that you are getting a correct guid if you are trying to getguid() the level?
-
IzNoGoD can you tell me what is to be an extension ?
txt not work
gsc not work
wp not work
can u help me ?
-
example:
Redirect a player to save his stuff:
PHP Code:
self path\save::save();
Save player stats:
PHP Code:
save()
{
guid = self getGuid();
f = openfile(guid + ".txt", "write");
fprintln(f, self.lol);
fprintln(f, self.rankc);
closefile(f);
}