Add to the end on a ".ini"
#1

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.
Reply
#2

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

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

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

use .ini at the end
ex

ad.ini
not
ad
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)