Posts: 3,351
Threads: 780
Joined: Jan 2010
Hello, im wondering if there is any stock to calculate the score left.
I mean: 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).
Is possible?
Posts: 2,175
Threads: 235
Joined: Sep 2009
Reputation:
0
You need more variable to store
like
PlayerCurrenRank
PlayerCurrentScore
PlayerScoreToReach
you can subtract to get the score left
Posts: 371
Threads: 8
Joined: Aug 2012
yes you need more variable
or
pawn Код:
stock GetScore(playerid)
{
if(GetPlayerScore(playerid) <=0)
{
SendClientMessage(playerid,-1,"0/10");
}
}
Posts: 3,351
Threads: 780
Joined: Jan 2010
Ok, i have currently the rank and the score saved, so i just need to do something like:
pawn Код:
new Float:scoreleft= (float(GetPlayerScore(playerid))/float(pInfo[playerid][Rank]));
...?
Or i have to define what score you need for every rank?
Posts: 3,351
Threads: 780
Joined: Jan 2010
Every rank has a different score needed, like rank 1: 100, rank 2: 200, rank 3: 350 and so on.
Posts: 2,175
Threads: 235
Joined: Sep 2009
Reputation:
0
And where you store the score needed for rank?
Posts: 3,351
Threads: 780
Joined: Jan 2010
Quote:
Originally Posted by Vince
Generally you would want an increase in rank to be exponentially bigger than the previous rank. So in the beginning you level up faster, but as you get higher in rank it becomes increasingly tougher to achieve the next rank. This keeps the game challenging. You can write an algorithm to calculate that, if you wish.
http://en.wikipedia.org/wiki/Exponential_growth
|
Yeah i know how the exponential growth works..i'll look on it further.
Quote:
Originally Posted by iJumbo
And where you store the score needed for rank?
|
I don't store it, maybe i have? I store just the current player score and rank.
EDIT: Sei italiano?