Score/Money Save
#1

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]);
....
Reply
#2

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

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
Reply
#4

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


Forum Jump:


Users browsing this thread: 2 Guest(s)