SA-MP Forums Archive
Y_INI Loading. - 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: Y_INI Loading. (/showthread.php?tid=565394)



Y_INI Loading. - Cow - 27.02.2015

Hi I'm new to scripting how to load something into a variable using y_ini? I've tried this code taken from Y_INI Tutorial and it doesn't work can anyone tell me about it.
pawn Код:
new
gSomeInteger;

forward anyini_examples(name[], value[]);
public anyini_examples(name[], value[])
{
    INI_Int("some_integer", gSomeInteger);
        return 1;
}


CMD:test(playerid,params[])
{
    INI_ParseFile("mine.INI", "anyini_%s");
    printf("%i",gSomeInteger);
    return 1;
}
CMD:makeinteger(playerid,params[])
{
    new file[20];
    format(file,sizeof(file),"mine.INI");
    if(fexist(file))
    {
        new INI:File = INI_Open(file);
        INI_SetTag(File,"examples");
        INI_WriteInt(File,"gSomeInteger",1);
        INI_Close(File);
    }
    else
    {
        print("file dont exist");
    }
    print("executed!");
    return 1;
}
Prints:
pawn Код:
 
Thnx.