|
void gf_BankFileLoadAndSaveForPlayer (int lp_player) {
string lv_diff;
bank lv_readBank;
lv_diff = "";
if(gv_scoreBank[lp_player] != null)
{
lv_readBank = gv_scoreBank[lp_player];
}
else
{
BankLoad("ScoreBank", lp_player);
lv_readBank = BankLastCreated();
gv_scoreBank[lp_player] = BankLastCreated();
BankOptionSet(BankLastCreated(), c_bankOptionSignature, true);
}
if(gv_selectedDifficulty == 1)//normal
{
lv_diff = "normal";
}
else if (gv_selectedDifficulty == 2)
{
lv_diff = "hard";
}
else
{
lv_diff = "invalid";
}
gv_playerBankRecordStats[lp_player][0] = 0;
gv_playerBankRecordStats[lp_player][1] = 0;
gv_playerBankRecordStats[lp_player][2] = 0;
gv_playerBankRecordStats[lp_player][3] = 0;
gv_playerBankRecordStats[lp_player][4] = 0;
gv_playerBankRecordStats[lp_player][5] = 0;
gv_playerBankRecordStats[lp_player][6] = 0;
gv_playerBankRecordStats[lp_player][7] = 0;
gv_playerBankRecordStats[lp_player][8] = 0;
gv_playerBankRecordStats[lp_player][9] = 0;
if ((BankVerify(lv_readBank) == true)) {
gv_playerBankRecordStats[lp_player][3] = BankValueGetAsInt(lv_readBank, lv_diff, "pem");
gv_playerBankRecordStats[lp_player][4] = BankValueGetAsInt(lv_readBank, lv_diff, "gem");
gv_playerBankRecordStats[lp_player][5] = BankValueGetAsInt(lv_readBank, lv_diff, "ot");
gv_playerBankRecordStats[lp_player][6] = BankValueGetAsInt(lv_readBank, lv_diff, "pt");
UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringToText("Valid"));
}
if(gv_playerStats[lp_player][2] > gv_playerBankRecordStats[lp_player][3])
{
gv_playerBankRecordStats[lp_player][3] = gv_playerStats[lp_player][2];
}
if(gv_playerStats[lp_player][4] > gv_playerBankRecordStats[lp_player][4])
{
gv_playerBankRecordStats[lp_player][4] = gv_playerStats[lp_player][4];
}
if(gv_playerStats[lp_player][5] > gv_playerBankRecordStats[lp_player][5])
{
gv_playerBankRecordStats[lp_player][5] = gv_playerStats[lp_player][5];
}
if(gv_playerStats[lp_player][6] > gv_playerBankRecordStats[lp_player][6])
{
gv_playerBankRecordStats[lp_player][6] = gv_playerStats[lp_player][6];
}
gv_playerStats[lp_player][3] = gv_playerBankRecordStats[lp_player][3];
gv_playerStats[lp_player][4] = gv_playerBankRecordStats[lp_player][4];
gv_playerStats[lp_player][5] = gv_playerBankRecordStats[lp_player][5];
gv_playerStats[lp_player][6] = gv_playerBankRecordStats[lp_player][6];
BankValueSetFromInt(lv_readBank, lv_diff, "pem", gv_playerStats[lp_player][3]);
BankValueSetFromInt(lv_readBank, lv_diff, "gem", gv_playerStats[lp_player][4]);
BankValueSetFromInt(lv_readBank, lv_diff, "ot", gv_playerStats[lp_player][5]);
BankValueSetFromInt(lv_readBank, lv_diff, "pt", gv_playerStats[lp_player][6]);
BankOptionSet(BankLastCreated(), c_bankOptionSignature, true);
BankSave(lv_readBank);
}
游戏启动。调用这代码。不会显示VALID。。再次调用就会显示VALID。然后退出下次再打开地图。。。又不显示了。。。。。。。BANK是正确保存了。。。
|
|