SA-MP Forums Archive
Can't get it... - 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: Can't get it... (/showthread.php?tid=265818)



Y_INI Problem... - Rock_Ro - 02.07.2011

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 ?


Re: Can't get it... - iPLEOMAX - 02.07.2011

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.


Re: Can't get it... - Rock_Ro - 02.07.2011

No...still same thing...


Re: Can't get it... - Rock_Ro - 02.07.2011

Anyone ?

Sorry for double post.


Re: Can't get it... - Skylar Paul - 02.07.2011

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.


Re: Can't get it... - Rock_Ro - 02.07.2011

Can't get it...

Others !?...