Problem with "Y_INI Deleting Values From a Userfile"
#1

Quote:
Originally Posted by ******
Посмотреть сообщение
Deleting

You can also delete values from a file:

pawn Код:
new
    INI:ini = INI_Open("myini.ini");
INI_RemoveEntry(ini, "NAME");
INI_Close(ini);
That will remove the "NAME" field from the current tag (see below). Simple as that. Deletions can also be mixed with writes:

pawn Код:
new
    INI:ini = INI_Open("myini.ini");
INI_WriteString(ini, "NAME", "******");
INI_WriteInt(ini, "SCORE", gScore);
INI_RemoveEntry(ini, "NAME");
INI_WriteFloat(ini, "HEALTH", health);
INI_Close(ini);
Imagine that i have 5 variables in the user data just like this:


Does this mean that if i want to delete Variable_3 it should looks like this Permanently?:


- If "Yes" Can somebody tell me why isn't this working??
I made a "Player's Playing Time in The Server" which should promote the player to the Regular Player Status with deleting a variable after a player reaching 24 hours in-game. But it's kinda promote the player without deleting the value, what's wrong in here?

pawn Код:
if(PlayerInfo[playerid][pPlayingHours] >= 24)
{
    if(PlayerInfo[playerid][pHasFailedCE] == 1)
    {
        new INI:File = INI_Open(UserPath(playerid));
        INI_RemoveEntry(File, "HasFailedCE");
        INI_Close(File);
    }
    //rest of code
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)