SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Help Archive (https://forum.sa-mp.com/forumdisplay.php?f=89)
-   -   Y_INI annoyin' issue (https://forum.sa-mp.com/showthread.php?t=209995)

blackwave 12/01/2011 12:57 AM

Y_INI annoyin' issue
 
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..

JaTochNietDan 12/01/2011 01:16 AM

Re: Y_INI annoyin' issue
 
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);

blackwave 12/01/2011 02:34 PM

Re: Y_INI annoyin' issue
 
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

blackwave 12/01/2011 03:26 PM

Re: Y_INI annoyin' issue
 
Anyone .... -.-


All times are GMT. The time now is 08:19 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.