Score left for next rank?
#10

Quote:

Hello, im wondering if there is any stock to calculate the score left

They're called functions - "stock" is just the name of an attribute.

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).

This is entirely possible by subtracting the player's score from the score needed to achieve next rank. To do this just store all the needed scores in a variable.

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 ))
;
Something like that.
Reply


Messages In This Thread
Score left for next rank? - by Face9000 - 15.04.2013, 18:32
Re: Score left for next rank? - by iJumbo - 15.04.2013, 18:34
Re: Score left for next rank? - by DaTa[X] - 15.04.2013, 18:36
Re: Score left for next rank? - by Face9000 - 15.04.2013, 18:36
Re: Score left for next rank? - by iJumbo - 15.04.2013, 18:40
Re: Score left for next rank? - by Face9000 - 15.04.2013, 18:43
Re: Score left for next rank? - by iJumbo - 15.04.2013, 18:43
Re: Score left for next rank? - by Vince - 15.04.2013, 18:44
Re: Score left for next rank? - by Face9000 - 15.04.2013, 18:46
Re: Score left for next rank? - by LarzI - 15.04.2013, 18:46

Forum Jump:


Users browsing this thread: 1 Guest(s)