02.07.2011, 15:13
Hello, i can't get it what's wrong with this code...
When player disconnects the stats are saved in "name".ini but when it connects it doesen't load.
What's wrong ?
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;
}
What's wrong ?