ItsMods

Full Version: Voting Plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi, would it be possible to have a custom vote plugin? An Admin could type a command such as !castvote Do you think im hot? Wink...and then it could give players the f1 and f2 option and say if the vote passes or not? or even better, give a percentage in chat? This would be useful if we are voting on what the next map should be or if we should change the gravity or speed on my server.

Also, it would be useful to have a command that can cancel the current vote that is pending. Such as !cancelvote, and whatever vote is being cast will be cancelled. Such as if a zombie votes to restart the map or if someone votes to kick another person, because we get a lot of vote spammers on my server.
we can't press any buttons, however it should be possible with stuff like !voteyes !voteno
It is possible. @Nukem get in here. Probably easiest to just put it in the addon
With F1/F2 support
Sweet, somebody should make this then. It would be really useful Tongue
(03-27-2012, 07:41)JariZ Wrote: [ -> ]we can't press any buttons, however it should be possible with stuff like !voteyes !voteno

(03-27-2012, 10:24)SuperNovaAO Wrote: [ -> ]It is possible. @Nukem get in here. Probably easiest to just put it in the addon
With F1/F2 support

at the moment isn't it possible with some thing like this?!
CSHARP Code
  1. public override void OnPlayerConnect(ServerClient Client)
  2. {
  3. /*SetClientDvar(Client.ClientNum, "unbind f1");
  4.   SetClientDvar(Client.ClientNum, "unbind f2");*/
  5. SetClientDvar(Client.ClientNum, "bind f2 \"say f2hasbeenpressed\"");
  6. SetClientDvar(Client.ClientNum, "bind f1 \"say f1hasbeenpressed\"");
  7. base.OnPlayerConnect(Client);
  8. }
  9. public override unsafe ChatType OnSay(string Message, ServerClient Client)
  10. {
  11. string lowMsg = Message.ToLower();
  12.  
  13. if (lowMsg.StartsWith("f2hasbeenpressed"))
  14. {
  15. ServerSay(Client.Name + " has voted NO", false);
  16. }
  17. else if ( lowMsg.StartsWith("f1hasbeenpressed"))
  18. {
  19. ServerSay(Client.Name + " has vote yes", false);
  20. }
  21. return ChatType.ChatContinue;
  22. }

ps: Please correct me if I am wrongSmile
Bind is a command, not a client dvar.. I don't think it'll work.
This is from config.cfg:

Code:
// generated by Infinity Ward, MODIFY!!!
unbindall
bind TAB "+scores"
bind ESCAPE "togglemenu"
bind SPACE "+gostand"
bind 1 "weapnext"
bind 2 "weapnext"
bind 3 "+actionslot 3"
bind 4 "+actionslot 4"
bind 5 "+actionslot 2"
bind A "+moveleft"
bind C "togglecrouch"
bind D "+moveright"
bind E "+melee_zoom"
bind F "+activate"
bind G "+frag"
bind N "+actionslot 1"
bind Q "+smoke"
bind R "+reload"
bind S "+back"
bind W "+forward"
bind PAUSE "pause"
bind CTRL "toggleprone"
bind SHIFT "+breath_sprint"
bind F5 "skip"
bind MOUSE1 "+attack"
bind MOUSE2 "+toggleads_throw"
bind MOUSE3 "+frag"
seta ai_badPathSpam "0"

If you look at the end (I didnt copy all), there is "seta", so "bind" must be the same so that might work @atenziono
So is it possible D:?
@kokole as @master131 said, bind is a command. Seta is also a command but when doing SetClientDvar the client automatically uses seta. It's not possible to use other commands.

Though with pressing F1/F2 it may be possible because the client actually sends a command to the server (vote yes/no).
So could someone "attempt" to make this? Big Grin
Pages: 1 2