Home
Forum
Rules
Search
Login
Register
January 08, 2025, 10:44:10 pm
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Follow Soldat on Social Media
:
Facebook
,
Twitter
,
Reddit
Official Soldat Forums
Server Talk
Scripting Discussions and Help
(Moderators:
chrisgbk
,
Bonecrusher
)
INI Files - changing, saving
« previous
next »
Pages: [
1
]
Author
Topic: INI Files - changing, saving (Read 972 times)
0 Members and 3 Guests are viewing this topic.
Vyka
Major
Posts: 59
INI Files - changing, saving
«
on:
December 26, 2008, 07:11:40 pm »
Hey, have a little problem.
How to change ini file. for example i have to:
visits=100
rest=0
change to
visits=101
rest=0
I use read function created by rampage_terranius to read
and how to save it?
Logged
Toumaz
Veteran
Posts: 1904
Re: INI Files - changing, saving
«
Reply #1 on:
December 26, 2008, 07:45:42 pm »
Use the search function.
http://forums.soldat.pl/index.php?topic=22338.0
(Or you could just WriteLn('visits=101'), for the record, if you're looking for a quicker and more specific solution. :P)
Logged
Vyka
Major
Posts: 59
Re: INI Files - changing, saving
«
Reply #2 on:
December 27, 2008, 06:20:39 am »
Thanks, i was reading it yesterday, but were a little drunk and dont remember exactly what i read.
Another Question:
Is it possible to create INI file by script?
Logged
Toumaz
Veteran
Posts: 1904
Re: INI Files - changing, saving
«
Reply #3 on:
December 27, 2008, 06:31:26 am »
Quote from: Vyka on December 27, 2008, 06:20:39 am
Is it possible to create INI file by script?
Uh, yeah? There's WriteFile and WriteFileLn, which is pretty much all you need, and if you need something a bit more high level there is the
script I've already linked you
.
... I somehow doubt this was your actual question though, since it feels like you're asking the same thing twice, so if I misinterpreted you in any way do please elaborate a little bit on what you mean by "create INI file by script".
Logged
Vyka
Major
Posts: 59
Re: INI Files - changing, saving
«
Reply #4 on:
January 03, 2009, 07:22:10 am »
ok, thanks, and one more question:
how to delete file? is it possible?
Logged
Toumaz
Veteran
Posts: 1904
Re: INI Files - changing, saving
«
Reply #5 on:
January 03, 2009, 07:36:17 am »
You could use
shell_exec
as long as the server isn't running in safe mode (for example, under Linux
shell_exec('rm ./path/to/file.txt');
).
Logged
Pages: [
1
]
« previous
next »
Official Soldat Forums
Server Talk
Scripting Discussions and Help
(Moderators:
chrisgbk
,
Bonecrusher
)
INI Files - changing, saving