SA-MP Forums Archive
Y_INI parsefile doesn't load integers - 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: Y_INI parsefile doesn't load integers (/showthread.php?tid=523467)



Y_INI parsefile doesn't load integers but loads strings o.O - Awide - 02.07.2014

In my script the players are able to save up to five characters on the user account. When they spawn with their selected character Y_INI should load their values. The strings load well but my integers aren't.

Here's an example, printing a few values (Sorry for my native language): http://i.imgur.com/gJDTH9S.png

It's really weird because I didn't change much in the code since it's working well at the login part, it perfectly parses the user's file.

So the problem is, the program loads all the strings but it doesn't load the integers.
I probably missed something in Y_Less's parsefile tutorial really badly... Can you give me a helping hand?

Edit: Code: http://pastebin.com/DMLZFpsZ


Re: Y_INI parsefile doesn't load integers - Awide - 02.07.2014

Bump anyone?


Re: Y_INI parsefile doesn't load integers - greentarch - 02.07.2014

Post your codes, and we will try to help.


Re: Y_INI parsefile doesn't load integers - Awide - 02.07.2014

Here you are.

http://pastebin.com/DMLZFpsZ


Re: Y_INI parsefile doesn't load integers - greentarch - 02.07.2014

Hmm.. actually, I don't see anything wrong.
The problem is the one at OnPlayerSpawn, right?
Try change
pawn Code:
INI_ParseFile(CharacterPath(playerid), "LoadCharacter_data", .bExtra = true, .extra = playerid);
to
pawn Code:
INI_ParseFile(CharacterPath(playerid), "LoadCharacter_%s", .bExtra = true, .extra = playerid);
Also I need more informations.. (sorry)
Write codes for /Characters/%s.ini --> INI_WriteInt, etcetera.
How your /Characters/%s.ini looks like --> Just copy paste what's inside there.

p.s: Before all your write codes for /Characters/%s.ini, try putting:
pawn Code:
INI_SetTag(YOUR_FILE_HERE, "data");



Re: Y_INI parsefile doesn't load integers - Awide - 02.07.2014

I tried it but it still doesn't load the integers.

Do you think the '_' could be problematic in the saved file names?

Here's the saving system
http://pastebin.com/sXhL9sux

A part from the saved file:
characters/Kei_Isuzu.ini
Code:
[data]
cName = Kei_Isuzu
cUser = Awide
cRace = 2
cSex = 1
cSkin = 141
cSkin2 = 0
cSkin3 = 0
cSkin4 = 0
cSkin5 = 0
cSkin6 = 0
cCash = 100
cCheck = 2000
cBankCash = 400



Re: Y_INI parsefile doesn't load integers - Awide - 06.07.2014

Bump, any ideas?