23.08.2015, 19:16
Help i have Problйm in Save Plyaer Money and Score.
this On OnPlayerconnect
OnDialogResponse (DIALOGID_REGISTER)
this is in a config Dialog
this in PlayerLogin
PHP код:
enum AccountInfo
{
Score,
Cash,
};
enum ServerData
{
SaveMoney,
SaveScore,
};
PHP код:
Account[playerid][Score] = 0;
Account[playerid][Cash] = 0;
Код:
INI_WriteInt(file,"Score",0); INI_WriteInt(file,"Cash",0);
Код:
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; }
Код:
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]); ....