SA-MP Forums Archive
Help with saving stats (Money and Score) - 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: Help with saving stats (Money and Score) (/showthread.php?tid=66695)



Help with saving stats (Money and Score) - V3nuZ - 23.02.2009

Hey all. I'm working on a little adminscript and need a bit of help with it :/

So im trying to get it to save stats. Here's what i got:

Код:
public OnPlayerDisconnect(playerid, reason)
{
	new pname[MAX_PLAYER_NAME];
	new Destination[50];
	format(Destination,sizeof(Destination),"\\Users\\%s.ini",pname);
	if (Logged[playerid] == 1)
 	{
 		GetPlayerName(playerid, pname, sizeof(pname));
 		dini_IntSet(udb_encode(Destination),"Money", GetPlayerMoney(playerid));
 		dini_IntSet(udb_encode(Destination),"Score", GetPlayerScore(playerid));
 	}
	return 1;
}
That code doesn't work, The stats dont save D: Please help :P

-V3-


Re: Help with saving stats (Money and Score) - Rks25 - 23.02.2009

doesnt that code work, or what is wrong with it?


Re: Help with saving stats (Money and Score) - V3nuZ - 23.02.2009

It doesn't work.


Re: Help with saving stats (Money and Score) - Jefff - 23.02.2009

Код:
public OnPlayerDisconnect(playerid, reason)
{
	new pname[MAX_PLAYER_NAME],Destination[256];
	GetPlayerName(playerid, pname, sizeof(pname));
	format(Destination,sizeof(Destination),"\\Users\\%s.ini",pname);
	if (dini_Exists(Destination) && Logged[playerid])
 	{
 		dini_IntSet(Destination,"Money", GetPlayerMoney(playerid));
 		dini_IntSet(Destination,"Score", GetPlayerScore(playerid));
 	}
	return 1;
}