/status doesn't updates
#1

Ok I got a small problem. I'm using an account save script (YSI) and everything is fine. I tested it and it saves and everything. (It saves when the player dissconnects and also saves some stats every half minute). The problem is the /status command: When I get in game I get 100$ so if I write /status I'll see Money: 100 then I use /money to give me 1000 more. After waiting 2 minutes I type /status again and Money is still 100 even if my money are 1100. When I disconnect and connect again when I use /status money is set to 1100. So it UPDATES only when I disconnect/connect and doesn't updates every half minute (Yes it saves every half minute but doesn't updates the /status info)

If you got any ideea of how to fix this here's my GM
Reply
#2

Cause you're not loading the data again in your timer once you saved.

pawn Код:
public SaveDataTimer(playerid)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"WEAPON_AMMU_1",PlayerInfo[playerid][pWam1]);
INI_WriteInt(File,"WEAPON_2",PlayerInfo[playerid][pW2]);
INI_WriteInt(File,"WEAPON_AMMU_2",PlayerInfo[playerid][pWam2]);
INI_WriteInt(File,"WEAPON_3",PlayerInfo[playerid][pW3]);
INI_WriteInt(File,"WEAPON_AMMU_3",PlayerInfo[playerid][pWam3]);
INI_WriteInt(File,"WEAPON_4",PlayerInfo[playerid][pW4]);
INI_WriteInt(File,"WEAPON_AMMU_4",PlayerInfo[playerid][pWam4]);
INI_WriteInt(File,"WEAPON_5",PlayerInfo[playerid][pW5]);
INI_WriteInt(File,"WEAPON_AMMU_5",PlayerInfo[playerid][pWam5]);
INI_WriteInt(File,"WEAPON_6",PlayerInfo[playerid][pW6]);
INI_WriteInt(File,"WEAPON_AMMU_6",PlayerInfo[playerid][pWam6]);
INI_WriteInt(File,"WEAPON_7",PlayerInfo[playerid][pW7]);
INI_WriteInt(File,"WEAPON_AMMU_7",PlayerInfo[playerid][pWam7]);
INI_WriteInt(File,"WEAPON_8",PlayerInfo[playerid][pW8]);
INI_WriteInt(File,"WEAPON_AMMU_8",PlayerInfo[playerid][pWam8]);
INI_WriteInt(File,"Skin",GetPlayerSkin(playerid));
INI_WriteInt(File,"Faction",gTeam[playerid]);
INI_WriteInt(File,"Skill",PlayerInfo[playerid][wSkill]);
INI_Close(File);
SendClientMessage(playerid, -1, "UPDATE");
return 1;
}
Should be:

pawn Код:
public SaveDataTimer(playerid)
{
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    INI_WriteInt(File,"WEAPON_AMMU_1",PlayerInfo[playerid][pWam1]);
    INI_WriteInt(File,"WEAPON_2",PlayerInfo[playerid][pW2]);
    INI_WriteInt(File,"WEAPON_AMMU_2",PlayerInfo[playerid][pWam2]);
    INI_WriteInt(File,"WEAPON_3",PlayerInfo[playerid][pW3]);
    INI_WriteInt(File,"WEAPON_AMMU_3",PlayerInfo[playerid][pWam3]);
    INI_WriteInt(File,"WEAPON_4",PlayerInfo[playerid][pW4]);
    INI_WriteInt(File,"WEAPON_AMMU_4",PlayerInfo[playerid][pWam4]);
    INI_WriteInt(File,"WEAPON_5",PlayerInfo[playerid][pW5]);
    INI_WriteInt(File,"WEAPON_AMMU_5",PlayerInfo[playerid][pWam5]);
    INI_WriteInt(File,"WEAPON_6",PlayerInfo[playerid][pW6]);
    INI_WriteInt(File,"WEAPON_AMMU_6",PlayerInfo[playerid][pWam6]);
    INI_WriteInt(File,"WEAPON_7",PlayerInfo[playerid][pW7]);
    INI_WriteInt(File,"WEAPON_AMMU_7",PlayerInfo[playerid][pWam7]);
    INI_WriteInt(File,"WEAPON_8",PlayerInfo[playerid][pW8]);
    INI_WriteInt(File,"WEAPON_AMMU_8",PlayerInfo[playerid][pWam8]);
    INI_WriteInt(File,"Skin",GetPlayerSkin(playerid));
    INI_WriteInt(File,"Faction",gTeam[playerid]);
    INI_WriteInt(File,"Skill",PlayerInfo[playerid][wSkill]);
    INI_Close(File);
    SendClientMessage(playerid, -1, "UPDATE");
    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); //Loading the data once again.
    return 1;
}
Reply
#3

Just saw ... thank you for you fast replay. Rep up ^-^
Reply
#4

Just did. Updated my post. Sorry about that.

EDIT: You're welcome.
Reply
#5

DELETED
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)