Posts: 140
Threads: 28
Joined: Jul 2010
Reputation:
0
there is an idea:
you can read the whole file, and when you get to the value you want to delete you skipping it.
then you remove the file and create a new one with the new content.
edit: i see you using dini... just use dini_Unset.
Posts: 51
Threads: 6
Joined: May 2010
Reputation:
0
can't it destroy my account's file
for example player's file it like this
level=1money=1
and when I use dini_Unset it's like this
level=1
money=1
and it can't read the file after it understand?
Posts: 6,129
Threads: 36
Joined: Jan 2009
Quote:
Originally Posted by xDeadlyBoy
there is an idea:
you can read the whole file, and when you get to the value you want to delete you skipping it.
then you remove the file and create a new one with the new content.
edit: i see you using dini... just use dini_Unset.
|
You should have looked at the code, the OP doesn't use it - he just includes it.
Quote:
can't it destroy my account's file
for example player's file it like this
level=1money=1
and when I use dini_Unset it's like this
level=1
money=1
and it can't read the file after it understand?
|
dini_Unset removes a file, so you don't want to do that.
Dini also would corrupt the file to how Godfather reads character files (assuming you're using the same method or the same code), simply because Dini uses '\r\n' for newlines, and Godfather only uses '\n' for newlines. You could probably modify the Dini include to remove the '\r' so it'll work.
Posts: 51
Threads: 6
Joined: May 2010
Reputation:
0
fixed it I took from dini and dutiles and it fixed!!