Modifying a value in .ini file using y_ini
#1

So I'm trying to modify this value:
Quote:

[Player's Data]
HouseID = 1
to 0.

The code I'm currently using is wrong, the results are this: (in the .ini file)
Quote:

HouseID = 0
[Player's Data]
HouseID = 1
It just adds the same variable above the tag, which is not what I want. I want the current value to be adjusted.

How can I do this? Current code:
Код:
new INI:file = INI_Open(offpath); // Correct path for the file
			INI_WriteInt(file,"HouseID", 0); // Write the value
			INI_Close(file); // close file
FIXED. Check below for the fix
Reply
#2

I haven't used Y_INI but I think you need to choose the tag or "key". Which is "Player's Data" in this case.
Reply
#3

Correct, it was an easy fix. Should've known... Thanks!

PHP код:
new INI:file INI_Open(Path(owner));
            
INI_SetTag(file,"Player's Data");
            
INI_WriteInt(file,"HouseID",pInfo[playerid][HouseID]);
            
INI_Close(file); 
Reply
#4

Glad I could help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)