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.
Saving a player stat from a map script.
Moderator: Core Staff
-
- CJ G0D!
- Posts: 1575
- Joined: June 3rd, 2009, 9:02 pm
- Location: Cardiff University, UK
-
- CJ G0D!
- Posts: 1575
- Joined: June 3rd, 2009, 9:02 pm
- Location: Cardiff University, UK
-
- Core Staff
- Posts: 2030
- Joined: July 24th, 2006, 11:21 am
- Location: Cramped in a small cubicle/making another jump map
Re: Saving a player stat from a map script.
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.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Saving a player stat from a map script.
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"
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"

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Who is online
Users browsing this forum: No registered users and 4 guests