15.04.2013, 18:46
Quote:
Hello, im wondering if there is any stock to calculate the score left |
Quote:
I have a rank system in my server and i wanna show the score left for the next rank: (Ex: Player is rank 1 with 10 score, for be rank 2 you need 15 score, so the score left for rank 2 is 5). |
When showing the score - simply subtract the score (GetPlayerScore) from the variable.
Example:
pawn Код:
// Globally you've defined the scores needed in an array, e.g.:
new
g_RankScores[] =
{
0, // Rank 1 should be the starting rank, so no score needed for that one
15, // Rank 2 should be at 15 score
// etc.
}
;
// Wherever you're showing the player's needed score to achieve next rank:
new
iNeededScore = ( g_RankScores[ VARIABLE_HOLDING_PLAYER_RANK ] - GetPlayerScore( playerid ))
;