SA-MP Forums Archive
Add to the end on a ".ini" - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Add to the end on a ".ini" (/showthread.php?tid=231307)



Add to the end of a ".ini" - bn102 - 25.02.2011

EDIT: Problem SOLVED



I have my users saved in .ini files. For example: Mine is Ben_Jarvis.ini and here is a section of the contents of that file:

Код:
Key=password
Level=1
AdminLevel=1338
HelperLevel=0
DonateRank=0
UpgradePoints=0
ConnectedTime=2
Registered=1
Sex=1
Age=20
So, if I have all of these users saved, how can I make it so that, when they next connect, it adds a value to the end.

What I am hoping to do is that a user can type /spawn 1, 2 or 3. And when they do that, it sets the value in their userfile. Wen they connect next, it will read the value, and they will spawn in the appropriate place.


Thank you,
Ben.


Re: Add to the end on a ".ini" - cessil - 25.02.2011

it depends what ini system you are using if you were using cini for example you could do
pawn Код:
cini_Save(playerid,"ddddddddddd",
            "Level",1,
            "AdminLevel",1338,
            "HelperLevel",0,
            "DonateRank",0,
            "UpgradePoints",0,
            "ConnectedTime",2,
            "Registered",1,
            "Sex",1,
            "Age",20
            "Spawn",1
            );



Re: Add to the end on a ".ini" - Baboon - 25.02.2011

I use d_ini.
Then you just do something like:

under onplayerspawn, you get the playerfile etc.
and then just use dini_Int or dini_Get


Re: Add to the end of a ".ini" - bn102 - 25.02.2011

Errm... To open the file it uses fopen and fread to read etc...


Re: Add to the end on a ".ini" - Ricop522 - 25.02.2011

use .ini at the end
ex

ad.ini
not
ad


Re: Add to the end on a ".ini" - bn102 - 25.02.2011

Ricop, please read my post before posting spam in this topic.