SA-MP Forums Archive
Money Saving Issue. - 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: Money Saving Issue. (/showthread.php?tid=440115)



Money Saving Issue. - Dare Devil..... - 28.05.2013

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel]);
INI_WriteInt(File, "Money",GetPlayerMoney( playerid ));
INI_WriteInt(File, "Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File, "Tester",PlayerInfo[playerid][pTester]);
INI_WriteInt(File, "Guard",PlayerInfo[playerid][pGuard]);
INI_WriteInt(File, "Vip",PlayerInfo[playerid][pVip]);
INI_WriteInt(File, "Spawn",PlayerInfo[playerid][pSpawn]);
INI_WriteInt(File, "Model",PlayerInfo[playerid][pModel]);
INI_WriteInt(File, "Locked",PlayerInfo[playerid][pLocked]);
INI_WriteInt(File, "FirstJoined", PlayerInfo[playerid][pFirstJoined]);
INI_WriteInt(File, "Sex", PlayerInfo[playerid][pSex]);
INI_WriteInt(File, "Age", PlayerInfo[playerid][pAge]);
INI_WriteInt(File, "Origin", PlayerInfo[playerid][pOrigin]);
INI_WriteInt(File, "Respect", PlayerInfo[playerid][pExp]);
INI_WriteInt(File, "Warns", PlayerInfo[playerid][pWarns]);
INI_WriteInt(File, "Selected", PlayerInfo[playerid][pSelected]);
INI_WriteInt(File, "Continent", PlayerInfo[playerid][pPlace]);
INI_WriteInt(File, "Muted", PlayerInfo[playerid][pMuted]);
INI_WriteInt(File, "MuteTime", PlayerInfo[playerid][pMuteTime]);
INI_WriteInt(File, "Ph", PlayerInfo[playerid][pNumber]);
INI_WriteInt(File, "DriveLic", PlayerInfo[playerid][pDriveLic]);
INI_Close(File);
return 1;
}
This is my on player Dissconnect when the player dissconect it saves the money into the .ini format but when he comes again to the server he is no given the money in his .ini file what should I place under my OnPlayerspawn


Re: Money Saving Issue. - dubyabeast - 28.05.2013

Well first off, when the player logs in, is there a variable that gets how much money is in the players .ini?
If there is, then go to OnPlayerSpawn, and add this:
pawn Код:
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney] // or whatever variable you use.



Re: Money Saving Issue. - radiobizza - 28.05.2013

Try to look in another gamemode on OnPlayerConnect