SA-MP Forums Archive
[Help] Money saving with DINI - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] Money saving with DINI (/showthread.php?tid=266389)



[Help] Money saving with DINI - Dream™ - 04.07.2011

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;
}



Re: [Help] Money saving with DINI - Dream™ - 04.07.2011

Anyone?


Re: [Help] Money saving with DINI - Ricop522 - 04.07.2011

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



Re: [Help] Money saving with DINI - Dream™ - 04.07.2011

Didn't help


Re: [Help] Money saving with DINI - Wesley221 - 04.07.2011

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