Vote (Old)
From EventScripts Community Encyclopedia
This is the old vote command [Eventscripts 1.2, 1.3]
OverviewSyntax: Note: Command parameters are described inside the
< and > characters. Optional parameters are contained within [ and ] characters.DescriptionCreates and handles user votes and runs a block at the end of the vote.
Parameters
Commands
ExamplesExample script using corelib's vote command: addons/eventscripts/votetester/es_votetester.txt block load { // vote requires corelib es_load corelib } event es_client_command { // every script that wants to do a vote needs to include a vote listener line in es_client_command vote listener } event player_say { if (event_var(text) equalto "!voteboy") do { // syntax: // vote start <name> <expire-time> <block-to-run> <question> <option1> <option2> [option3] [option4] ... [option9] vote start voteboy 10 votetester/vote_done "What map do you want?" "de_dust" "cs_italy" "de_dust2" "scoutzknivez" "cs_office" } } // this is the block we configured to be called when the vote is over. block vote_done { if (server_var(vote_answertext) != 0) do { es_msg #green Vote done: Map will change in 5 seconds to server_var(vote_answertext) es_delayed 5 changelevel server_var(vote_answertext) } else do { es_msg #green Vote cancelled: not enough votes. } } Notes
See also |
