SA-MP Forums Archive
[Solved]Y_ini issue - 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: [Solved]Y_ini issue (/showthread.php?tid=471627)



Y_ini issue - xVIP3Rx - 24.10.2013

Okay I'm trying to create a file and store data on it, the file is created but there is no data, here's the code..
pawn Код:
#define PATH    "Somewhere/%s.ini"
    if(dialogid == 1)
    {
        if(response)
        {
            if(strlen(inputtext))
            {
                new File[100];
                format(File, sizeof(File), PATH, inputtext);
                if(!fexist(File))
                {
                    new INI:ACCOUNT = INI_Open(File);
                    INI_WriteInt(ACCOUNT, "Test", 1);
                {
            }
        }
        return 1;
    }
The file is created, But there is nothing inside it, So what's the problem ?


Re: Y_ini issue - Chrillzen - 24.10.2013

You have to close the file.


Re: Y_ini issue - RowdyrideR - 24.10.2013

https://sampforum.blast.hk/showthread.php?tid=273088

https://sampforum.blast.hk/showthread.php?tid=244223


Re: Y_ini issue - Threshold - 24.10.2013

First of all, I just want to point out that one of your braces is facing the wrong way. (Opening brace instead of a closing brace)

pawn Код:
if(dialogid == 1)
    {
        if(response)
        {
            if(strlen(inputtext) > 0)
            {
                new File[100];
                format(File, sizeof(File), PATH, inputtext);
                if(!fexist(File))
                {
                    new INI:ACCOUNT = INI_Open(File);
                    INI_WriteInt(ACCOUNT, "Test", 1);
                    INI_Close(ACCOUNT);
                }
            }
        }
        return 1;
    }
This should be working...

EDIT: Somehow, two slippery buggers managed to post before I finished writing this up.


Re: Y_ini issue - xVIP3Rx - 24.10.2013

Quote:
Originally Posted by Chrillzen
Посмотреть сообщение
You have to close the file.
Oh how can I forget that, Thanks.

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
First of all, I just want to point out that one of your braces is facing the wrong way. (Opening brace instead of a closing brace)

pawn Код:
if(dialogid == 1)
    {
        if(response)
        {
            if(strlen(inputtext) > 0)
            {
                new File[100];
                format(File, sizeof(File), PATH, inputtext);
                if(!fexist(File))
                {
                    new INI:ACCOUNT = INI_Open(File);
                    INI_WriteInt(ACCOUNT, "Test", 1);
                    INI_Close(ACCOUNT);
                }
            }
        }
        return 1;
    }
This should be working...

EDIT: Somehow, two slippery buggers managed to post before I finished writing this up.
Thanks anyway


Y_ini issue - xVIP3Rx - 24.10.2013

Deleted - Made another thread.