Saving stats when server restart
#1

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?
Reply
#2

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;
}
Reply
#3

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

Код:
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 ?
Reply
#5

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...
Reply
#6

Fix.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)