Saving Score Using No Extra Include
#2

I don't understand why you want this, but here:

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;
Reply


Messages In This Thread
Saving Score Using No Extra Include - by 0_o - 03.08.2011, 17:52
Re: Saving Score Using No Extra Include - by iPLEOMAX - 03.08.2011, 18:25
Re: Saving Score Using No Extra Include - by 0_o - 03.08.2011, 19:01
Re: Saving Score Using No Extra Include - by Kush - 03.08.2011, 19:08
Re: Saving Score Using No Extra Include - by Mean - 03.08.2011, 19:15
Re: Saving Score Using No Extra Include - by 0_o - 04.08.2011, 19:10
Re: Saving Score Using No Extra Include - by Tigerkiller - 04.08.2011, 19:41
Re: Saving Score Using No Extra Include - by MadeMan - 04.08.2011, 19:51
Re: Saving Score Using No Extra Include - by 0_o - 04.08.2011, 21:07

Forum Jump:


Users browsing this thread: 3 Guest(s)