MasterACE14 Posted October 24, 2007 Share Posted October 24, 2007 Good Afternoon Everyone, I have a Text MMORPG, and I am trying to figure out how to "Rank" all the players, basically, each player has a strikeaction, defenceaction and covertaction column in the database, and I want to assign an Integer(their rank) to each player depending on what their 3 actions added together are. So the person who would be Ranked "1", would have the highest action(when strike, defence and covert are added together). And the lowest person would have the smallest action etc. Now, what I would like to do, is add a "Rank" column to the database for each user, and have each hour(my cronjob) update their "rank" column with an integer, depending on what their total action is compared to every other player. How would I go about this? Regards ACE Quote Link to comment https://forums.phpfreaks.com/topic/74548-solved-ranking-players/ Share on other sites More sharing options...
Toshiba23 Posted October 24, 2007 Share Posted October 24, 2007 Just have their scores update the "rank" column, if they have more points in the rank column, higher overall player rank they are. So (going off runescape stats, I know funny...) attack + defence + strength = 99 (at one hour in the day) another hour it adds up to 105 105+99 = 204 ( i think ) 204 > a person with 156 so 204 is a higher rank. Am I on the right track? Quote Link to comment https://forums.phpfreaks.com/topic/74548-solved-ranking-players/#findComment-376813 Share on other sites More sharing options...
MasterACE14 Posted October 24, 2007 Author Share Posted October 24, 2007 you've lost me lol, I know how to "UPDATE" their rank column depending on their actions, but how do I make each rank uniqu for each user? I can't have 2 or more players "Rank 1" Quote Link to comment https://forums.phpfreaks.com/topic/74548-solved-ranking-players/#findComment-376818 Share on other sites More sharing options...
Toshiba23 Posted October 24, 2007 Share Posted October 24, 2007 well when you output the memberlist just lie to people (if someone has the same score as another, they don't need to know it) just have "ORDER BY rank DESC" Quote Link to comment https://forums.phpfreaks.com/topic/74548-solved-ranking-players/#findComment-376822 Share on other sites More sharing options...
MasterACE14 Posted October 24, 2007 Author Share Posted October 24, 2007 well when you output the memberlist just lie to people thats not very professional :-\ Quote Link to comment https://forums.phpfreaks.com/topic/74548-solved-ranking-players/#findComment-376823 Share on other sites More sharing options...
Toshiba23 Posted October 24, 2007 Share Posted October 24, 2007 well chances are, someone will have the same score as another person, therefore you can't have an honest rank 1 (sometimes), thats why a simple solution, is just use a mysql "ORDER BY" in the query... Quote Link to comment https://forums.phpfreaks.com/topic/74548-solved-ranking-players/#findComment-376825 Share on other sites More sharing options...
MasterACE14 Posted October 24, 2007 Author Share Posted October 24, 2007 this is true, but still need to have unique values, if more 1 player has the same actions, then it should just go by alphabetical order, for those with the same or something, I have seen many websites work the rankings in this similar way. Quote Link to comment https://forums.phpfreaks.com/topic/74548-solved-ranking-players/#findComment-376828 Share on other sites More sharing options...
Toshiba23 Posted October 24, 2007 Share Posted October 24, 2007 ORDER BY rank, user_name Quote Link to comment https://forums.phpfreaks.com/topic/74548-solved-ranking-players/#findComment-376829 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.