Y_ini, reading... - 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, reading... (
/showthread.php?tid=272104)
Y_ini, reading... -
Kush - 27.07.2011
Alright, so I recently switched from SII and decided to give Y_ini a try (too many conflicts and complications). But in SII, I would use the INI_ReadInt or INI_ReadString to simply read my values in an ini file. What would be the 'alternative' to those functions in Y_ini. Heres an example:
pawn Код:
PlayerInfo[playerid][pAdmin] = INI_ReadInt( "Admin" );
^ SII. Y_ini function would be.....?
AW: Y_ini, reading... -
Nero_3D - 27.07.2011
Something like that
pawn Код:
INI_ParseFile("filename.ini", "FuncToCall", .bExtra = true, .extra = playerid);
pawn Код:
forward FuncToCall(playerid, name[], value[]);
public FuncToCall(playerid, name[], value[]) {
INI_Int("Admin", PlayerInfo[playerid][pAdmin]);
}
Maybe you read that again:
How to use y_ini
Re: Y_ini, reading... -
Kush - 27.07.2011
I understand this already, and thanks for posting. But my main question of would be how would that (what you have posted) be called in either a response or callback.
pawn Код:
INI_ParseFile("filename.ini", "FuncToCall", .bExtra = true, .extra = playerid);
forward FuncToCall(playerid, name[], value[]);
public FuncToCall(playerid, name[], value[])
{
INI_Int("Admin", PlayerInfo[playerid][pAdmin]);
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
//Called in here to Load User File.
}
return 1;
}
Re: Y_ini, reading... -
Kush - 27.07.2011
Thank you ******.
Re: Y_ini, reading... -
Srdjan - 27.07.2011
I have kind of similar problem, so I won't make new topic.
Under OnPlayerConnect I have "INI_ParseFile (UserPath (playerid), "load_user_data_%s", .bExtra = true, .extra = playerid);"
and in "load_user_data_basic" I have INI_Int("Password", PlayerInfo[playerid][pPassword]);
I tried everything, but it doesn't want to load my password. That's probably the problem with all "readings" from that function, but I haven't tested.
Any suggestions how to fix it?
Re: Y_ini, reading... -
Srdjan - 27.07.2011
Wasn't. But now I did and it fixed the problem. Thanks brother!