@verb #3200:"@vote" any on top of/on/onto/upon any rxdo #7407 @program #3200:"@vote" any on top of/on/onto/upon any if ((NUM = $code_utils:toint(iobjstr)) == E_TYPE) return player:tell("You have to use the vote's ID number. (Look at \"@topics\")") endif try {creator, title, desc, options, voters, expiry} = this.topics[NUM] except (E_RANGE) return player:tell("You tried to view a topic that does not exist.") endtry if (listassoc(player, voters)) return player:tell("You have already voted. (Use \"@unvote\" to cancel your vote first)") endif !dobjstr && (dobjstr = $command_utils:read("your vote")) if (options) if ((vote = $code_utils:toint(dobjstr)) == E_TYPE) return player:tell("You have to use the option's ID number. (Try \"@view ", NUM, "\" to get the option numbers)") elseif (`options[vote] ! E_RANGE' == E_RANGE) return player:tell("You entered an option number that was out of range. (Try looking at \"@view ", NUM, "\" again)") else voters = {@voters, {player, vote}} endif else if ((vote = $code_utils:toint(dobjstr)) == E_TYPE && !(index("yes", dobjstr) == 1 && (vote = 1) || (index("no", dobjstr) == 1 && (vote = 2)))) return player:tell("You must enter either \"Yes\" or \"No\"") else voters = {@voters, {player, vote}} endif endif this.topics[NUM] = {creator, title, desc, options, voters, expiry && expiry + 86400 / 2} player:tell("Your vote has been registered!") "Last modified by Dax (#789) on Wed May 4 06:36:14 2005 MDT." .