Can't get it...
#1

Hello, i can't get it what's wrong with this code...
pawn Код:
SaveStats( playerid )
{
    new UserFile[ 32 ];
    format( UserFile, sizeof ( UserFile ), "Radmin/%s.ini", pName( playerid ) );
   
    new INI:file = INI_Open( UserFile );
    INI_SetTag(file, "PlayerData");
   
    INI_WriteInt(file, "MONEY:", RPlayerData[ playerid ][ R_MONEY ] );
    INI_WriteInt(file, "SCORE:", RPlayerData[ playerid ][ R_SCORE ] );
    INI_WriteInt(file, "LEVEL:", RPlayerData[ playerid ][ R_LEVEL ] );

    INI_Close( file );
}

LoadStats( playerid )
{
    new
        UserFile[ 32 ];
    format( UserFile, sizeof ( UserFile ), "Radmin/%s.ini", pName( playerid ) );
   
    INI_ParseFile(UserFile, "Load_%s", .bExtra = true, .extra = playerid);
}

forward Load_PlayerData( playerid, name[ ], value[ ] );
public Load_PlayerData( playerid, name[ ], value[ ] )
{
    INI_Int("MONEY:", RPlayerData[ playerid ][ R_MONEY ] );
    INI_Int("SCORE:", RPlayerData[ playerid ][ R_SCORE ] );
    INI_Int("LEVEL:", RPlayerData[ playerid ][ R_LEVEL ] );
   
    return 1;
}
When player disconnects the stats are saved in "name".ini but when it connects it doesen't load.
What's wrong ?
Reply
#2

Change this: INI_ParseFile(UserFile, "Load_%s", .bExtra = true, .extra = playerid);

To: INI_ParseFile(UserFile, "Load_PlayerData", .bExtra = true, .extra = playerid);

Then try.. I think It'll work.
Reply
#3

No...still same thing...
Reply
#4

Anyone ?

Sorry for double post.
Reply
#5

You appear to be using YSI, so I suggest taking a look at this wiki page, although it appears to me as if you are using the correct format, and it SHOULD work; it obviously isn't for some odd reason.
Reply
#6

Can't get it...

Others !?...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)