Posts: 3,351
Threads: 780
Joined: Jan 2010
Hello,i've a problem with a save some stats in a fine.I used this code to save the total N° of players kills.
Here is:
OnGameModeInit:
pawn Код:
TotalKills = dini_Int("/LOGS/sestats.txt","TotalKills");
OnPlayerDeath:
The problem is,it logs the kills but if i restart the server,the Players Kills Stats are set to 0.How to fix this and save it in a file?
Posts: 3,351
Threads: 780
Joined: Jan 2010
Sorry for hour bump but it's important..
Posts: 1,564
Threads: 98
Joined: Apr 2011
Reputation:
0
You probably dont have 'dini_IntSet()' in your script, so it adds one to the variable, but doesnt save in the file.
Posts: 3,351
Threads: 780
Joined: Jan 2010
Quote:
Originally Posted by Wesley221
You probably dont have 'dini_IntSet()' in your script, so it adds one to the variable, but doesnt save in the file.
|
So,i've to add the dini_IntSet(TotalKills) under the TotalKills++ variable?
Quote:
Originally Posted by Jaxson
Have you loaded the variable mentioned above when player logs in?
|
OnGameModeInit,not when player login.
Posts: 3,351
Threads: 780
Joined: Jan 2010
Thanks,ok then:
pawn Код:
dini_IntSet("/LOGS/sestats.txt","TotalKills", TotalKills);
is to parse TotalKills in the file.
And to read it again if server restarts?
Posts: 119
Threads: 10
Joined: Oct 2010
Reputation:
0
Yes, you need to load the variable again when the server starts. OnGameModeInit callback.