08.11.2014, 20:16
you have to define new variables and load ini data into it.
for example i have a player ini file and i want to load player money to "PlayerMoney[playerid]" Variable.
"INI_ParseFile" need call a function. so we will make it
my.ini file content:
[data]
Money = 2000
for example i have a player ini file and i want to load player money to "PlayerMoney[playerid]" Variable.
"INI_ParseFile" need call a function. so we will make it
my.ini file content:
[data]
Money = 2000
pawn Код:
new PlayerMoney[MAX_PLAYERS]; //>defining the variable
//>creating function
forward MyFunction_data(playerid,name[],value[]);
public MyFunction_data(playerid,name[],value[])
{
INI_Int("Money",PlayerMoney[playerid]); //> Loading an integer (player money amount) from "Money" Value to PlayerMoney[playerid] variable
return 1;
}
INI_ParseFile("my.ini", "MyFunction_%s", .bExtra = true, .extra = playerid);