INI Parse Loading +REP
#1

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.

Reply
#2

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
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)