INI Parse File help
#1

Hello I need someone to explain me INI ParseFile, I need following:

pawn Код:
new
   IntVar,
   StringVar[24],
   Float:FloatVar;
I need someone to explain me how to load those variables from file

Saving:

pawn Код:
stock saveVars();
{
   new INI:File = INI_Open("/Variables/vars.ini");
   INI_WriteInt(File, "IntVar", IntVar);
   INI_WriteString(File, "StringVar", StringVar);
   INI_WriteFloat(File, "FloatVar", FloatVar);
   INI_Close(File);
   return 1;
}
Reply
#2

pawn Код:
INI_ParseFile("/Variables/vars.ini", "getVar_Stats", .bExtra = true, .extra = playerid);
// This will load everything below + allow you to use playerid. Use this when you want
// to load the players data for the first time. It has to be under a function which has
// playerid as a parameter.

forward getVar_Stats(playerid,name[],value[]);
public getVar_Stats(playerid,name[],value[])
// This will return the information wanted (value[]) for the playerid. Through
// Y_INI.
{
    INI_Int("IntVar", IntVar);
    INI_String("StringVar", StringVar, 24);
    INI_Float("FloatVar", FloatVar);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)