SA-MP Forums Archive
INI Parse Loading +REP - 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: INI Parse Loading +REP (/showthread.php?tid=505506)



INI Parse Loading +REP - Lidor124 - 08.04.2014

I am using Y INI, all goes smooth till i use loops...
I gave in the following codes example of loops with weapons ammo, when i in the server it saves the weapon ID and ammo properly but when i relog, then the problems start.
NOTE: I use format for saving data.

So save values with loop:

Код:
for(new s = 0; s < 12; s++)
			{
				SaveValidAmmo(playerid);
				format(var, 32, "wSlot%d", s);
				INI_WriteInt(File, var, PlayerInfo[playerid][pGuns][s]);
				format(var, 32, "wSlot%dAmmo", s);
				INI_WriteInt(File, var, PlayerInfo[playerid][pAGuns][s]);
			}
That's how i loading when player connects using INI_ParseFile:

Код:
for(new s = 0; s < 12; s++)
	{
		INI_Int("wSlot%d", PlayerInfo[playerid][pGuns][s]);
		INI_Int("wSlot%dAmmo", PlayerInfo[playerid][pAGuns][s]);
	}
Results:
That's empty data but when i in server it writes it properly, when i relog it sets my health to 0 and kills me - i tried it without loops and it didn't kill me so the problem is the loops.




Re: INI Parse Loading +REP - xVIP3Rx - 08.04.2014

I think, There's something that equals those values to zero when you connect or something, Check these variables for anything that might change them to zero


Re: INI Parse Loading +REP - Lidor124 - 09.04.2014

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
I think, There's something that equals those values to zero when you connect or something, Check these variables for anything that might change them to zero
I found the problem, the problem isn't something equals to zero although i have it under public OnPlayerConnect, the problem was that i have 3 publics which belong to INI, not all the three were same so that what made me to death.
Any way ty 4 help +REP