[Help] Money saving with DINI
#1

I got problem with money saving, money doesn't save so it doesn't load when I get back IG. But If I set it in users.cfg it loads. Can anyone help me?

Код:
public OnPlayerDisconnect(playerid, reason)
{
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), SERVER_USER_FILE, name);
    if(gPlayerLogged[playerid] == 1)
    {
		PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
		dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdmin]);
        dini_IntSet(file, "HelperLevel",PlayerInfo[playerid][pHelper]);
		dini_IntSet(file, "Bans", PlayerInfo[playerid][pBans]);
		dini_IntSet(file, "Kicks", PlayerInfo[playerid][pKicks]);
        dini_IntSet(file, "Warns", PlayerInfo[playerid][pWarns]);
		dini_IntSet(file, "Jailed", PlayerInfo[playerid][pJailed]);
		dini_IntSet(file, "JailTime", PlayerInfo[playerid][pJailTime]);
		dini_IntSet(file, "Kills", PlayerInfo[playerid][pKills]);
        dini_IntSet(file, "Deaths", PlayerInfo[playerid][pDeaths]);
		dini_IntSet(file, "Money", PlayerInfo[playerid][pCash]-GetPlayerMoney(playerid));
		dini_IntSet(file, "LAE", PlayerInfo[playerid][pLAE]);
		dini_IntSet(file, "DrivLic", PlayerInfo[playerid][pDrivLic]);
		dini_IntSet(file, "GunLic", PlayerInfo[playerid][pGunLic]);
		dini_IntSet(file, "Cigarettes", PlayerInfo[playerid][pCigarettes]);
		dini_IntSet(file, "Lighter", PlayerInfo[playerid][pLighter]);
	}
    gPlayerLogged[playerid] = 0;
    new pName[MAX_PLAYER_NAME];
    new string[56];
    GetPlayerName(playerid, pName, sizeof(pName));

    switch(reason)
    {
        case 0: format(string, sizeof(string), "((%s has left the the City Of Los Santos!))", pName);
        case 1: format(string, sizeof(string), "((%s has left the the City Of Los Santos!))", pName);
        case 2: format(string, sizeof(string), "((%s has left the the City Of Los Santos!))", pName);
    }

    SendClientMessageToAll(0x0000FFAA, string);
	return 1;
}
Reply
#2

Anyone?
Reply
#3

PHP код:
dini_IntSet(file"Money"PlayerInfo[playerid][pCash]); 
Reply
#4

Didn't help
Reply
#5

pawn Код:
dini_IntSet(file, "Money", GetPlayerMoney(playerid));
Try that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)