Money Doubling - 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 Doubling (
/showthread.php?tid=529479)
Money Doubling -
McBan - 02.08.2014
Yo,
I have scripted a system where the players money saves when they disconnect and the player gets it back when he next logs in. The problem starts when he connects.
When a player connects instead of giving him the actual amount, It gives him double. For example I had 3000 and I quit then re-joined and it gave me back 6000. I have checked the script just incase I set it twice anywhere else, But nope.
Hope you guys can help me out
Код:
public OnPlayerConnect(playerid)
{
LoadCharacter(playerid);
return 1;
}
Код:
stock LoadCharacter(playerid)
{
if(INI_Open(GetUser(playerid)))
{
PlayerInfo[playerid][Money] = INI_ReadInt("Money");
PlayerInfo[playerid][Score] = INI_ReadInt("Score");
PlayerInfo[playerid][Administrator] = INI_ReadInt("Administrator");
PlayerInfo[playerid][AdminLevel] = INI_ReadInt("AdminLevel");
PlayerInfo[playerid][Health] = INI_ReadFloat("Health");
PlayerInfo[playerid][Armour] = INI_ReadFloat("Armour");
PlayerInfo[playerid][Skin] = INI_ReadInt("Skin");
PlayerInfo[playerid][TutorialCompleted] = INI_ReadInt("TutorialCompleted");
PlayerInfo[playerid][pX] = INI_ReadFloat("pX");
PlayerInfo[playerid][pY] = INI_ReadFloat("pY");
PlayerInfo[playerid][pZ] = INI_ReadFloat("pZ");
INI_Save();
INI_Close();
}
return 1;
}
Everything saves but when its loading it doubles it then hands it out.
Re: Money Doubling -
Blademaster680 - 02.08.2014
Could you show us the saving function please