SA-MP Forums Archive
Problem with "Y_INI Deleting Values From a Userfile" - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with "Y_INI Deleting Values From a Userfile" (/showthread.php?tid=521072)



Problem with "Y_INI Deleting Values From a Userfile" - Juvanii - 21.06.2014

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;
}



Re: Problem with "Y_INI Deleting Values From a Userfile" - Juvanii - 22.06.2014

Bump!


Re: Problem with "Y_INI Deleting Values From a Userfile" - Juvanii - 24.06.2014

Bump!


Re: Problem with "Y_INI Deleting Values From a Userfile" - Juvanii - 24.06.2014

Bump!


Re: Problem with "Y_INI Deleting Values From a Userfile" - Juvanii - 30.06.2014

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


Re: Problem with "Y_INI Deleting Values From a Userfile" - Juvanii - 01.07.2014

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


Re: Problem with "Y_INI Deleting Values From a Userfile" - Stanford - 18.07.2014

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


Re: Problem with "Y_INI Deleting Values From a Userfile" - Juvanii - 19.07.2014

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.


Re: Problem with "Y_INI Deleting Values From a Userfile" - Sawalha - 24.07.2014

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


Re: Problem with "Y_INI Deleting Values From a Userfile" - Juvanii - 24.07.2014

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