SA-MP Forums Archive
Score/Money Save - 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)
+--- Thread: Score/Money Save (/showthread.php?tid=586643)



Score/Money Save - anassmaroc - 23.08.2015

Help i have Problйm in Save Plyaer Money and Score.
PHP код:
 enum AccountInfo
 
{
    
Score,
    
Cash,
 };
 
enum ServerData
 
{
    
SaveMoney,
    
SaveScore,
 }; 
this On OnPlayerconnect
PHP код:
    Account[playerid][Score]      = 0;
    
Account[playerid][Cash]       = 0
OnDialogResponse (DIALOGID_REGISTER)
Код:
  				INI_WriteInt(file,"Score",0);
  				INI_WriteInt(file,"Cash",0);
this is in a config Dialog
Код:
			if(EnabDisab[playerid][SaveMoney] == 1)
			{
				ServerInfo[SaveMoney] = 1;
				dini_IntSet(file,"SaveMoney", ServerInfo[SaveMoney]);
				EnabDisab[playerid][SaveMoney] = 0;
			}
			if(EnabDisab[playerid][SaveScore] == 1)
			{
				ServerInfo[SaveScore] = 1;
				dini_IntSet(file,"SaveScore", ServerInfo[SaveScore]);
				EnabDisab[playerid][SaveScore] = 0;
			}
this in PlayerLogin
Код:
LoginPlayer(playerid)
{
	new file[256],PlayerName[MAX_PLAYER_NAME];
	GetPlayerName(playerid,PlayerName,MAX_PLAYER_NAME);
	format(file,sizeof(file),PLAYER_FILE,PlayerName);

	new str[256];

	INI_ParseFile(file, "LoadPlayerData", .bExtra = true, .extra = playerid);

	SetPlayerScore(playerid, Account[playerid][Score]);
	GivePlayerMoney(playerid, Account[playerid][Cash]);
....



Re: Score/Money Save - JaKe Elite - 23.08.2015

What is the problem exactly, You havent mentioned the problem, you just gave us the code like we can just guess the problem by our own and give you a new code.


Re: Score/Money Save - anassmaroc - 23.08.2015

Quote:
Originally Posted by JaKe Elite
Посмотреть сообщение
What is the problem exactly, You havent mentioned the problem, you just gave us the code like we can just guess the problem by our own and give you a new code.
The Score and Money Don't saves


Re: Score/Money Save - CrazyChoco - 24.08.2015

Never used ini before (mysql ftw).
But why don't you save aany data in onplayerdisconnect