找回密码
 点一下
查看: 1030|回复: 2

。。。求助这BANK怎么回事

[复制链接]
发表于 2014-2-28 17:31:11 | 显示全部楼层 |阅读模式
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是正确保存了。。。
 楼主| 发表于 2014-2-28 17:43:03 | 显示全部楼层
只有第一次打开地图调用会出问题,中途调用N次都没问题的。。
回复

使用道具 举报

发表于 2014-3-1 19:20:26 | 显示全部楼层
为什么贴这种代码。用galaxy就好好写galaxy,用GUI触发器的话就直接贴触发器。

这种明显是GUI转的galaxy。难道说你没有GUI源码,改的是别人的加密地图?事先说明本论坛禁止改别人的加密地图来发布。


还有,BankLoad的玩家参数不能用脚本和变量来Load。也就是说你要打开bank,就必须每个玩家写一行BankLoad。乖乖用GUI,然后把玩家号直接填进去。

BankLoad是个伪代码,根本不能在Galaxy里直接用的。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-11-28 02:20 , Processed in 0.379116 second(s), 20 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表