SA-MP Forums Archive
Saving stats when server restart - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Saving stats when server restart (/showthread.php?tid=199780)



Saving stats when server restart - Face9000 - 16.12.2010

Hi,i've a little problem.

For my gm i use this values when someone register:

Код:
	  dini_IntSet(file, "Password", udb_hash(tmp));
			  dini_IntSet(file,"AdminLevel", 0);
			  dini_IntSet(file,"Cash", 0);
			  dini_IntSet(file,"Score", 0);
			  dini_IntSet(file,"Deaths", 0);
I need to do,when my server restart,he save:

AdminLevel
Cash
Score
Deaths

How to?


Re: Saving stats when server restart - blackwave - 16.12.2010

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new name[MAX_PLAYERS];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"%s.ini",name);
dini_IntSet(file,"AdminLevel",PlayerInfo[playerid][AdminLevel]);
dini_IntSet(file,"Cash",GetPlayerMoney(playerid));
dini_IntSet(file,"Score",GetPlayerScore(playerid));
dini_IntSet(file,"Deaths", deaths[playerid]); // need to create a death count before...
return 1;
}



Re: Saving stats when server restart - willsuckformoney - 16.12.2010

Saving stats when server is crashed/restarting isn't a goo idea, better to set a timer, 2minutes I suggest.


Re: Saving stats when server restart - Face9000 - 16.12.2010

Код:
C:\Documents and Settings\k\Desktop\SFWAR.pwn(1008) : error 017: undefined symbol "file"
C:\Documents and Settings\k\Desktop\SFWAR.pwn(1008) : error 017: undefined symbol "file"
C:\Documents and Settings\k\Desktop\SFWAR.pwn(1008) : error 029: invalid expression, assumed zero
C:\Documents and Settings\k\Desktop\SFWAR.pwn(1008) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
umh...

@Willsuckformoney (LOL),how to ?


Re: Saving stats when server restart - blackwave - 16.12.2010

Did you define the directory? need to put a global variable:

pawn Код:
new file[256];


This forum requires that you wait 60 seconds between posts. Please try again in 13 seconds.



Seem you didn't define anything...


Re: Saving stats when server restart - Face9000 - 16.12.2010

Fix.