Saving Score Using No Extra Include
#5

It's because you save it in OnPlayerDisconnect, and you can't save it on timeout/disconnect. Try to leave the server, and join back in, your score will probably be the same from when you left.

Anyways, here's a DINI version, which I wouldn't recommend:
pawn Код:
//saving:
new
    file[ 128 ]
    ,pName[ 24 ]
;
GetPlayerName( playerid, pName, 24 );
format( file, sizeof file, "%sscr.txt", pName );
if( !dini_Exists( file ) ) {
    dini_Create( file );
}
dini_IntSet( file, "score", GetPlayerScore( playerid ) );

//loading:
new
    file[ 128 ]
    ,pName[ 24 ]
;
GetPlayerName( playerid, pName, 24 );
format( file, sizeof file, "%sscr.txt", pName );
if( dini_Exists( file ) ) {
    SetPlayerScore( playerid, dini_Int( file, "score" ) );
}
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: 1 Guest(s)