Make an array, if you want so much these "NoScope","Normal",etc. you can make an enum.
Like:
PHP Code:
enum
{
VOTE_NOSCOPE = 0,
VOTE_NORMAL,
VOTE_GRAVITY,
VOTE_VIP,
MAX_VOTES
}
new vote_options[MAX_VOTES]
And then you can use:
PHP Code:
vote_options[VOTE_NOSCOPE]++
Or better in your case you can remove this switch and use only this:
PHP Code:
vote_options[item]++
The loop will be:
PHP Code:
new i, max_value
for(i=0;i<4;i++) if(vote_options[i] > vote_options[max_value]) max_value = i
It starts the loop at slot 0 (variable i) of the array and then checks if it's value is bigger than that's from the slot number max_value. If it's bigger, then max_value is set to i and the check continues with i = slot 1. If the value of slot 1 is bigger than the value of max_value, which is now slot 0, then set max_value to the value slot 1. Then the loop goes to slot 2 - if the value of slot 2 is bigger than that of slot 1, set max_value to the value of slot 2. At the next step i is the value of slot 3 - if the value if slot 3 is bigger than that of slot 2, set max_value to 3... and so on...
So at the end you get the highest value of the options in the array, in the max_value variable and then you can use it like this:
PHP Code:
vote_options[max_value]
-> max_value is the slot of the array with the highest value.
__________________