SA-MP Forums Archive
Big problem with saving money - 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)
+--- Thread: Big problem with saving money (/showthread.php?tid=400567)



Big problem with saving money - FL3GM4 - 19.12.2012

well, my saving system can't save money...

Код:
public OnPlayerDisconnect(playerid, reason)
{
 	OnPlayerLogout(playerid);
 	SendDeathMessage(INVALID_PLAYER_ID,playerid, 201);
	return 1;
}
Код:
OnPlayerLogout(playerid)
{
    new uFile[35];

    format(uFile, 35, USER_FILE, PlayerName(playerid));

    new INI:playerFile = INI_Open(uFile);
    INI_WriteInt(playerFile, "Admin", PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(playerFile, "VIP", PlayerInfo[playerid][CHB]);
    INI_WriteInt(playerFile, "Novac", PlayerInfo[playerid][pMoney]);
    INI_WriteInt(playerFile, "Skin", GetPlayerSkin(playerid));
    INI_WriteInt(playerFile, "Warn", PlayerInfo[playerid][warn]);
    INI_WriteInt(playerFile, "Ubojstva", PlayerInfo[playerid][pKills]);
    INI_WriteInt(playerFile, "Lider", PlayerInfo[playerid][Lider]);
    INI_WriteInt(playerFile, "Clan", PlayerInfo[playerid][Clan]);
    INI_WriteInt(playerFile, "Rank", PlayerInfo[playerid][Rank]);
    INI_WriteInt(playerFile, "Smrti", PlayerInfo[playerid][pDeaths]);
    INI_WriteInt(playerFile, "Minute", PlayerInfo[playerid][Minute]);

    INI_Close(playerFile);
    return 1;
}



Re: Big problem with saving money - Konstantinos - 19.12.2012

Change to
pawn Код:
INI_WriteInt(playerFile, "Novac", GetPlayerMoney(playerid));
Unless, you're using server side for money and you should use it as you did.


Re: Big problem with saving money - RedCrossER - 19.12.2012

PlayerInfo[playerid][pMoney]

^^ it's getting updated current money of the player?


Re: Big problem with saving money - FL3GM4 - 19.12.2012

Quote:
Originally Posted by RedCrossER
Посмотреть сообщение
PlayerInfo[playerid][pMoney]

^^ it's getting updated current money of the player?
yes, but on relog money gone..

now its resolved, i think