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
#2

Bump!
Reply
#3

Bump!
Reply
#4

Bump!
Reply
#5

Why nobody is responding guys? I think i explained my problem enough!!!
Reply
#6

Another explain: can't i delete a line from userfile.ini ???????????????????????????????
Reply
#7

Set them to zero OR just delete at saving part those values same with loading
Reply
#8

Quote:
Originally Posted by Stanford
Посмотреть сообщение
Set them to zero OR just delete at saving part those values same with loading
It doesn't delete it when i remove it from the saving/loading part.
Reply
#9

Show me the path of your file (Userpath stock) please
Reply
#10

here you are ...
pawn Код:
stock UserPath(playerid)
{
    new string[128];
    format(string,sizeof(string),"/Users/%s.ini",GetName(playerid));
    return string;
}
Reply


Forum Jump:


Users browsing this thread: