How to get the highest value
Hi guys! I need to get the highest value of a few variables. I don't like to use if because I have to compare all the values to each other and it's very clumsy.
And one more question - how can I easily check if two or more of the values are the same because there "will be two highest values" but in this case I want to chose randomly one (because the code goes wrong and no value is chosen in this case). The values are stored in Votes[5], Votes[7], Votes[9], Votes[11], Votes[15]. |
Re: How to get the highest value
Look at how vote plugins are done. They all have a loop to find the highest value. For duplicates, you can loop back through after getting the highest value and checking if there is more than one equal to the highest value.
|
Re: How to get the highest value
|
Re: How to get the highest value
Quote:
Quote:
|
Re: How to get the highest value
Quote:
|
Re: How to get the highest value
Look at the Advanced Vote Menu in the menu tutorial.
|
Re: How to get the highest value
I wanted to tell it to him aswell, but he doesn't want to do it with checks.
|
Re: How to get the highest value
Quote:
|
| All times are GMT -4. The time now is 12:11. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.