SA-MP Forums Archive
Y_INI annoyin' 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Y_INI annoyin' issue (/showthread.php?tid=209995)



Y_INI annoyin' issue - blackwave - 12.01.2011

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..


Re: Y_INI annoyin' issue - JaTochNietDan - 12.01.2011

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);



Re: Y_INI annoyin' issue - blackwave - 12.01.2011

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



Re: Y_INI annoyin' issue - blackwave - 12.01.2011

Anyone .... -.-