Adding new strings to an existing INI file
#1

For example, my current example.ini user file has following data:

Код:
Username = example
Password = example
Skin = 123
If I wish to add a new string, for example, "AdminLevel", would I have to delete example.ini in order to update it trough the script?
Reply
#2

Which file system are you using?
Reply
#3

I'm using y_ini.
Reply
#4

Here's an example of writing data to an INI file with y_ini:

pawn Код:
new INI:ini = INI_Open("myini.ini");
INI_SetTag(ini, "LVDM");
INI_WriteString(ini, "NAME", "******");
INI_WriteInt(ini, "SCORE", gScore);
INI_Close(ini);
So as you can see, you're basically doing the following:

opening the file
writing a string
writing an integer
closing the file
Reply
#5

https://sampforum.blast.hk/showthread.php?tid=273088 learn.........
Reply
#6

Thank you, RealCop228.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)