Y_INI annoyin' issue
#1

On dini, you can do:
pawn Code:
PlayerInfo[playerid][Cash] = dini_Int(file,"Cash");

But on y_ini, how do I do it?

I tried as correctly:
pawn Code:
INI:playerfile[](name[], value[])
{
   INI_Int("cash",GetPlayerMoney(playerid));
   return 0;
}

Give me error of undefined symbol: playerid. Means there's no "playerid " on the structure. So, how do I add? I really need it..
Reply
#2

Your syntax is wrong, that function is the function that stores the information into the variables. Like so:

pawn Code:
INI:playerfile[](playerid, name[], value[])
{
   INI_Int("cash",PlayerInfo[playerid][Cash]);
   return 0;
}
That function goes anywhere in the script.

Then when you want to load the data you would run:

pawn Code:
INI_Load("playerfile.ini", true, playerid);
Reply
#3

Well jatoch, it keep giving me a annoying and senseless error...
pawn Code:
CMD:reset(playerid,params[])
{
   #pragma unused params
   Msg(playerid, color, ""#red"logged variable "#green" reseted");
   logged[playerid]=0;
   new name[MAX_PLAYER_NAME];GetPlayerName(playerid,name,sizeof(name));
   format(playerfile,sizeof(playerfile),PLAYER,name);
   INI_Load(PLAYER, playerid, true);
   return 1;
}
INI:playerfile[](playerid, name[], value[])
{
   INI_String("Name",PlayerInfo[playerid][Name]);
   return 0;
}
Code:
 error 017: undefined symbol "INI_String"
I tested other cases with INI Loading and works, except this one: INI_String. I checked the inc and has this function. Also tried with normal arrays, and did work. Except for:
pawn Code:
PlayerInfo[playerid][Name] // I have defined
Reply
#4

Anyone .... -.-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)