Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ Voting System.. Help Anyone?
|
Voting System.. Help Anyone?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Xyrex
(12 posts) Bio
|
| Date
| Wed 13 Mar 2002 07:12 PM (UTC) |
| Message
| I want to implement a voting system on my mud, but I don't know WHERE to begin! Here is what I want it to do in a nutshell.
--KEY--
-> = does action
"" = does command
-------
Player A -> "candidate council1"
Player B -> "vote player A council1"
Player 1 votes = 1 for Position council1
------------------------------------------------
In essence, I want a person to be able to first toggle a flag that marks them as a candidate (versus they meet min. req.) - then other players can vote on him, for that certain position. But I also have to have another check, Player A and Player B both must be in the same "Kingdom" (which I suppose I could setup using a flag in char_data, and compare against that). Basically there will be several kingdoms and they should be able to vote for 4 council member positions within their own kingdom only. And I want an imm command to "make the voting" time ready.. I could do this by cedit'ng the levels of the commands above to 65 until I declare it voting time.?! ..
Any ideas, help, info, sites, would be GREATLY appreciated thanks a lot. I think I can handle it, I just need a starting point.
Xyrex | | Top |
|
| Posted by
| Xyrex
(12 posts) Bio
|
| Date
| Reply #1 on Thu 14 Mar 2002 05:55 PM (UTC) |
| Message
| hmm, maybe it was alittle too complex. Can anyone atleast point me to a good place to ask this question? Atleast to find some info on where I can go to give me some insights on how to do this...
--Xyrex | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #2 on Thu 14 Mar 2002 09:36 PM (UTC) |
| Message
| Yes, you would need a couple of extra fields in the character data. eg.
int is_candidate;
int votes;
int kingdom;
int has_voted;
You would initially set "is_candidate" "votes" and "has_voted" to zero (false). Then they can become a candidate if they want. Also they vote by adding 1 to the "votes" field for their candidate (providing the kingdom matches), and then set the "has_voted" flag for the person doing the voting, otherwise they could vote twice.
You could have a system-wide flag about whether an election is running, as at the point of starting the election is an obvious place to clear the "votes" and "has_voted" fields. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
13,282 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top