How to change a line string in a file
#1

Like, you have this:

scriptfiles/count_stats.ini
pawn Код:
players alive: 34
players death: 6
How to change the line with; players alive: 34
Reply
#2

You would need random access to change a specific line only, but fwrite does only support sequential.
A possibility (without plugins, if there are some for RA) would be to read the whole file line-by-line, look for the players alive line, change it (the variable containing it) and rewrite the whole file.

You could also use a ini fs, it does almost the same.
Reply
#3

But how does iClone it? He doesn't change a string anywhere :P
Reply
#4

Use DINI. It's easier to edit.

It would read:

Alive=34
Dead=6

You can then edit each record with one line of code.
Reply
#5

Not dini, djSon seeing how it's much faster and stable (And seeing how it was made as "dini2").
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)