Page 1 of 1

Saving a player stat from a map script.

Posted: December 23rd, 2013, 7:52 pm
by F |Madness| U
Is this possible? I know you can set player stats from within mods, to keep track of useful information. However can you set similar stats from a custom map? For example I want to save a player stat which records the time in which they completed the map, I know you can save these times on particular servers using dvars, but if the server is rebooted, or the player joins a different server, it won't have their saved time.

So yeah, anybody know if this is possible and how to go about doing it if it is?

Thanks.

Re: Saving a player stat from a map script.

Posted: December 23rd, 2013, 7:54 pm
by F |Madness| U
-

Re: Saving a player stat from a map script.

Posted: December 23rd, 2013, 10:01 pm
by Rezil
In theory, yes. You can save their time as a simple variable when the player connects(onConnected, get the connected player, add a var to the player entity). For permanent saving you could try openFile and the file read functions.

Re: Saving a player stat from a map script.

Posted: December 23rd, 2013, 10:47 pm
by Drofder2004
I believe in CoD4 you can save to the data file (similar to how CJ mod gives XP to a player).
I don't have the code to hand, but I am fairly certain all the stats fall under:

self.pers["stat"];

Use Windows grep (or something similar) to search for ".pers"