Raised This Month: $32 Target: $400
 8% 

Custom Votes v0.3


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   General Purpose        Approver:   devicenull (200)
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 07-10-2004 , 15:09   Custom Votes v0.3
Reply With Quote #1

********************************************* *******************************
*
* Version 0.3 - Date: 03/17/2006
*
* Created by: jtp10181 <[email protected]>
* Homepage: http://www.jtpage.net
*
********************************************* *******************************

This plugin allows you to add a custom vote for virtually anything. All you need to know is the cvar or server command to turn the plugin on and off.

Features:
  • Add any amount of votes to the config file and it loads them on map changes
  • Nearly all aspects of the votes are customizable
  • Different timer/delay modes to suit your needs
  • Reads the vote delay from the standard AMXx cvar setting
  • Easy console menu system for admins to start votes and change settings
  • Matrix style jumping is done entirely by this vote plugin because only a CVAR needs to be changed
  • Config file included for all plugins written or maintained by me
Admin Commands:

amx_custvote - Console menu system for changing vote settings

Examples:
amx_custvote - Shows the console admin vote menu
amx_custvote #2 - Starts vote #2
amx_custvote matrix - Starts the vote with trigger "matrix"
amx_custvote #2 off - Disable public voting for #2
amx_custvote #2 save - Save the current public voting status as the default for #2
amx_custvote #2 on save - Enable public voting for #2 AND save that as the default

amx_custcancelvote - Cancels current voting session

Client Command:

say vote_<trigger> - Starts a vote if public voting is enabled

Config File: This should be located at <configs_dir>/custvote.cfg
Here is an example config file that could be used

Code:
//Config file for amx_customvotes.sma
//Created by jtp10181
 
//This file belongs at <configs_dir>/custvote.cfg
 
//Sample Config Entry
//The vote can be activated by saying "vote_trigger"
//[trigger]
//D    "Description used in results"
//Q    "Vote question?"
//Y    "YES question choice"
//N    "NO Answer choise"
//H    "Help line to be displayed if vote succeeds"
//The following two can be cvars settings or any server command
//YC    "server command to run if vote passes"
//NC    "server command to run if vote failes"
//The following can be set to different modes and is optional
//    * -1 - No timer checking
//    *  0 - Use plugin global timer (default if not set)
//    *  1 - Use server global timer (same as adminvote)
//    *  2 - Use vote specific timer
//TM    0
 
[matrix]
D    "Matrix Jumping"
Q    "Do you want Matrix style jumping?"
Y    "Hand me the red pill!"
N    "No thanks"
YC    "sv_airaccelerate -15"
NC    "sv_airaccelerate 10"
 
[hook]
D    "Grappling Hook"
Q    "Allow the Grappling Hook?"
Y    "Yes, I want to Hook
N    "No, the Hook is stupid"
YC    "sv_hook 1"
NC    "sv_hook 0"
H    "- Say /hook for help"
TM    2
CVARs: Paste the following into your amxx.cfg to change defaults.
You must uncomment cvar lines for them to take effect

Code:
// ******************  Custom Vote Settings  ******************
 
//Custom Vote Admin Override (CVAO)
// 0 - admins are forced to obey vote timers
// 1 - vote timers are ignored for the console admin commands
//amx_cvao 0
Changelog:

v0.3 - JTP10181 - 03/17/06
  • Added option for custom vote ratio
v0.2 - JTP10181 - ??/??/??
  • Allowed more chars to be read from config file
  • Made use of plugin_cfg native to delay the reading of the config file
v0.1 - JTP10181 - 07/10/04
  • First Release
Thanks to the AMXX Dev Team for the orginal adminvote plugin.
The core voting code for this plugin was borrowed from there.

********************************************* **************************

This is my first major plugin I coded mostly from scratch. I know that this is kind of redundant of another plugin but I feel this one has an easier to use config file and I belive it has more features when it comes to the custom voting part.

Please give me some feedback. I am interested in feature requests and bug reports and anything else you want to say about this plugin.

********************************************* **************************
Votes Included in Sample Config File********************************************* **************************
Attached Files
File Type: zip custvote.zip (922 Bytes, 2643 views)
File Type: sma Get Plugin or Get Source (amx_customvotes.sma - 3394 views - 21.8 KB)
__________________

Last edited by jtp10181; 08-10-2006 at 21:31.
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
kingpin
Veteran Member
Join Date: Apr 2004
Location: kpsforum.com
Old 07-10-2004 , 15:12  
Reply With Quote #2

nice plugin but lol kinda like : JGHG's plugin eh?
__________________
kingpin is offline
Send a message via ICQ to kingpin Send a message via AIM to kingpin Send a message via MSN to kingpin Send a message via Yahoo to kingpin Send a message via Skype™ to kingpin
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 07-10-2004 , 15:18  
Reply With Quote #3

Quote:
Originally Posted by jtp10181
I know that this is kind of redundant of another plugin but I feel this one has an easier to use config file and I belive it has more features when it comes to the custom voting part.
Yeah its similar but its not the same. Some people might find this one easier to use and more specific to what they want to do, other people might find the other one to have more features overall that they want to use. This plugin is more specifically targeted at one purpose.
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
Freddie Mercury
Junior Member
Join Date: Jul 2004
Old 07-10-2004 , 15:41  
Reply With Quote #4

I like this much better than Johnny's. I'd like it even more if you added the ability to have multiple choices in votes, though. I'm trying to set up an MP3 vote, and it'd work great with this plugin if it could do more than Y/N votes.
__________________
I see no signature.
Freddie Mercury is offline
Send a message via AIM to Freddie Mercury
kingpin
Veteran Member
Join Date: Apr 2004
Location: kpsforum.com
Old 07-10-2004 , 15:41  
Reply With Quote #5

yeah thats would be great Jtp I would love it if you could add the multiple options.
__________________
kingpin is offline
Send a message via ICQ to kingpin Send a message via AIM to kingpin Send a message via MSN to kingpin Send a message via Yahoo to kingpin Send a message via Skype™ to kingpin
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 07-10-2004 , 15:53  
Reply With Quote #6

I saw that coming, heh. Right now it is only setup for yes/no style votes.

I will have have to look at making it work for totally different styles of votes. The hardest part will be the config file, I may have it use a different config file for the other style of votes to reduce the number of settings in the main one.

What about something like this?
That would give the total freedom of the options and the commands to run for each option. But these would be server commands.

To play an MP3 would it need to be a client commad on each client? I could add an extra flag on there to enable the vote to do a client command.

Code:
[mp3]
D	"MP3 Selection"
Q	"Choose an MP3 to Play"
C1	"choice1"	"command1"
C2	"choice2"	"command2"
C3	"choice3"	"command3"
C4	"choice4"	"command4"
Also a few other things I was thinking about adding were:

Option to enable/disable ALL votes with one command
Menu system to change settings and enable/disable votes instead of console commands.

I think they would be useful and might get added eventually.
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
kingpin
Veteran Member
Join Date: Apr 2004
Location: kpsforum.com
Old 07-10-2004 , 15:59  
Reply With Quote #7

lol good ideas but if u think about it there are like a million things u can add to it lol. like having a coupla levels of votes some for admins some for pub etc. but being able turn on/off all votes is cool.
__________________
kingpin is offline
Send a message via ICQ to kingpin Send a message via AIM to kingpin Send a message via MSN to kingpin Send a message via Yahoo to kingpin Send a message via Skype™ to kingpin
Freddie Mercury
Junior Member
Join Date: Jul 2004
Old 07-10-2004 , 16:00  
Reply With Quote #8

All those options would be great, but the MP3 voting is what would make this plugin different and great. I'm not always in my server to play the MP3s using the speech menu.
__________________
I see no signature.
Freddie Mercury is offline
Send a message via AIM to Freddie Mercury
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 07-15-2004 , 09:32  
Reply With Quote #9

Copycat!! :-)

Although my plugin probably is kind of messy written, I wrote it ages ago...
Johnny got his gun is offline
Crazed_climber
Junior Member
Join Date: Aug 2004
Old 08-18-2004 , 03:04  
Reply With Quote #10

So how do I use timers. I want of my votes to start at the beginning of every map.
Crazed_climber 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 14:36.


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