rank player from variable
Hi, I have a problem, because I'm trying to make a player's rating, which would be created on the basis of variable giExperience. I save giExperience in nvault. How can I do?
Sample message: client_print(id, print_chat, "Your rank is %d/%d (You have %d experience)", gPlayerRank[id], gMaxPlayersOfRank, giExperience[id]); sorry for my English because it is weak, and thank you for your help: D |
Re: rank player from variable
So where is ur problem ? because the sample message is right.
|
Re: rank player from variable
I know just how to figure out which player is ranked (position is based on that experience) and it's probably gMaxPlayersOfRank get_statsnum () but I'm not sure.
Sample: gMaxPlayersOfRank = get_statsnum(); gPlayerRank[id] = /* I can not do that */ client_print(id, print_chat, "Your rank is %d/%d (You have %d experience)", gPlayerRank[id], gMaxPlayersOfRank, giExperience[id]); |
Re: rank player from variable
untested
PHP Code:
|
Re: rank player from variable
get_user_stats only for kills and deaths
from csstats.inc: /* Gets overall stats which are stored in file on server * and updated on every respawn or user disconnect. * Function returns the position in stats by diff. kills to deaths. */ native get_user_stats(index,stats[8],bodyhits[8]); |
Re: rank player from variable
Thats how stats works, based on kills/deaths which is what I figured you were using since you used get_statsnum() which is based off of the same ranking system.
get_user_stats() Gets overall stats which are stored in file on server and updated on every respawn or user disconnect. Function returns the position in stats by differece in kills to deaths. Position = rank. If you want to make your own ranking system with your own calculations you will need to do the math and then sort the list of players. I edited my post above with code. |
Re: rank player from variable
That math is going to be easy, but I do not know how to sort the players.
You can try to do loops: for (new id = 0; id <get_statsnum (), id + +) What do you think? |
Re: rank player from variable
Why are you using get_statsnum though if you are using your own ranking system?
I would store each players stats in vault and then read all entries into an array then sort using SortCustom2D |
Re: rank player from variable
Sorry but I do not know how to do it so i am really noob :<
edit: Could you do it or start? I try to finish. Exolent or xPaw you have any ideas? : / |
| All times are GMT -4. The time now is 20:09. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.