Raised This Month: $ Target: $400
 0% 

tally votes for 9 different options


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stupok
Veteran Member
Join Date: Feb 2006
Old 10-06-2006 , 14:53   tally votes for 9 different options
Reply With Quote #1

I've been looking around at other vote plugins for a way to tally votes for 9 items, and Xanimos' master_vote.amxx plugin is the only one I found that lets users vote for 9 items.

But, when looking at his code, it is beyond me how he calculates which item wins the vote. I'd appreciate a quick guide on doing that.
stupok is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-06-2006 , 23:46   Re: tally votes for 9 different options
Reply With Quote #2

Less detailed: http://forums.alliedmods.net/showpos...34&postcount=2

More detailed: http://forums.alliedmods.net/showpos...68&postcount=5
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 10-06-2006 , 23:58   Re: tally votes for 9 different options
Reply With Quote #3

Did I not make clear what I was looking for? Sorry if I did not .

I'll try again. There are 9 options for a vote.
1. something
2. something else
3. something else else
4. something else else else
5. something still different
6. something yet more different
7. something again different
8. something slightly different
9. something not so different

Now, one client voted for #1, another voted for #5, another voted for #7, etc. until all of the clients have voted!
How can I determine which option (1-9) has the most votes?
stupok is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-07-2006 , 00:00   Re: tally votes for 9 different options
Reply With Quote #4

The first and foremost requirement is that you have a brain.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-07-2006 , 00:15   Re: tally votes for 9 different options
Reply With Quote #5

Code:
new votes[9], i, winner; for(i=1;i<9;i++) {      if(votes[i] > votes[winner]) winner = i; }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 10-07-2006 , 00:43   Re: tally votes for 9 different options
Reply With Quote #6

Wow! Look at that elegant bit of code! Thank you XxAvalanchexX!!!
stupok is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:49.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode