Y_ini, reading...
#1

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.....?
Reply
#2

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
Reply
#3

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;
}
Reply
#4

Thank you ******.
Reply
#5

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?
Reply
#6

Wasn't. But now I did and it fixed the problem. Thanks brother!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)