Problems with INI_ParseFile (y_ini)
#1

Hello,

I'm experiences some issues with INI_ParseFile in Y_Ini. It appears to be called like this:...
pawn Код:
INI_ParseFile(string, "LoadAccountPass_data", .bExtra = true, .extra = playerid);
... but then it also calls "LoadAccountPass_data" 7 times and "Store" only contains (null)!

pawn Код:
INI_ParseFile(string, "LoadAccountPass_%s", .bExtra = true, .extra = playerid);
But when I do it like this it doesn't even call it a single time (and yes, I am sure this code gets reached!)

For your information, the callback:

pawn Код:
forward LoadAccountPass_data(playerid, name[], value[]);
public LoadAccountPass_data(playerid, name[], value[])
{
    new Store[129];
    INI_String("Password",Store,sizeof(Store));
    SetPVarString(playerid,"Password",Store);
    return 1;
}
Is there any statement for this?

- Jochem
Reply
#2

OnPlayerConnect to load the data ( Password )
pawn Код:
INI_ParseFile(string, "LoadAccountPass_%s", .bExtra = true, .extra = playerid);
On player login
pawn Код:
// Campare with strcmp password and params/inputtext, if it's correct
INI_ParseFile(string, "LoadAccountPass_%s", .bExtra = true, .extra = playerid);
Reply
#3

Yes, that is what I already had, but where I was asking for is why it is not working...
Reply
#4

Do you use Whirlpool?
If yes.
1st Way: You can use enums
pawn Код:
enum pInfo
{
    PLAYER_PASS[ 129 ],
    // Rest
}
new
    PlayerInfo[ MAX_PLAYERS ][ pInfo ];

// --
forward LoadAccountPass_data( playerid, name[ ], value[ ] );
public LoadAccountPass_data( playerid, name[ ], value[ ] )
{
    INI_String( "Password", PlayerInfo[ playerid ][ PLAYER_PASS ], 129 );
    // Rest
    return 1;
}
Or PVars
pawn Код:
forward LoadAccountPass_data( playerid, name[ ], value[ ] );
public LoadAccountPass_data( playerid, name[ ], value[ ] )
{
    if( !strcmp( name, "Password" ) ) SetPVarString( playerid, "PassWord", value );
    return 1;
}
Reply
#5

Thanks, but it still didn't answer my question...

Edit: At least I found out why it calls it 7 times, but not why it returns (null)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)