03.08.2011, 18:25
I don't understand why you want this, but here:
Quite useless IMO.
Quite useless IMO.
pawn Код:
// For saving:
new name[MAX_PLAYER_NAME], scr, string[64];
GetPlayerName( playerid, name, sizeof(name) );
scr = GetPlayerScore( playerid );
format( string, sizeof(string), "%s.scr" );
new File:userfile = fopen( string, io_write );
format( string, sizeof(string), "%i",scr );
fwrite( userfile, string );
fclose( userfile );
return 1;
// For Loading:
new name[MAX_PLAYER_NAME], string[64];
GetPlayerName( playerid, name, sizeof(name) );
format( string, sizeof(string), "%s.scr" );
if( !fexist(string) ) return true;
new File:userfile = fopen( string, io_read );
fread( userfile, string );
fclose( userfile );
SetPlayerScore( playerid, strval(string) );
return 1;