HeliVote

Allows players to open a vote to call helicopters

Total Downloads: 5,511 - First Release: Jan 24, 2016 - Last Update: Feb 3, 2017

5/5, 11 likes
  1. Hey Is there a way to put this on a timed command? When I try to set one up with rusty, the command does nothing unless I type it in the actual game chat. Any help would be appreciated!
     
  2. k1lly0u updated HeliVote with a new update entry:

    0.1.2


    [DOUBLEPOST=1457741676][/DOUBLEPOST]
    Use this console command to setup vote automation
     
  3. I don't know if you can but is it possible to make it of majority rules out of those who votes
    eg. there is 40 players on so it need 20 yes votes to be complete but only 10 voted so instead can you make it so it counts the votes out of those 10 and majority of votes out of the 10 decide if it is yes or no.
    [DOUBLEPOST=1459037248,1458973599][/DOUBLEPOST]
    UPDATE: I simply just changed it to Yes>=No instead it from comparing with the required vote number requirement
    [DOUBLEPOST=1459048838][/DOUBLEPOST]k1lly0u I really like this plugin are you able to make one for vote day and have like /voteday yes and /voteday no, because I know if you do it will be just as great and will be way better than other vote day solutions.
     
  4. There is a day/night vote plugin that is similar to this with a yes and no vote. Can't remember what it is called though.
    There probably isn't much point in making a new one because so many already exist
     
  5. k1lly0u updated HeliVote with a new update entry:

    0.1.3

     
  6. hello, is it possible to initiate the command helivote XX and bypass the vote requierment??? I want to use this command to send heli on player who have bought the command via ServerRewards plugin.
     
  7. Yes i know but i want the heli go only on the player who buy the command, i don't think it's possible with helicontrol.
     
  8. You would need a plugin to handle the helicopters behavior, this isn't really the plugin for that
     
  9. Helivote can send helico on player who initiate the vote but if i want they pay for this command i can't allow vote on helivote for all player, just on the player who initiate the vote.
     
  10. Hi!

    Would it be possible for you to change how the permission works or add one more permission? I'd like to give a specific group permission to start the helicopter vote BUT i want all players to be able to see the status/statistics going on with the voting & to be able to vote yes/no.

    Would this be possible? It'd been greatly appreciated, cheers :)
     
  11. k1lly0u updated HeliVote with a new update entry:

    0.1.31

     
  12. [08/19/2016 02:18:06] [Oxide] 02:17 [Error] Failed to initialize plugin 'HeliVote v0.1.31' (JsonReaderException: After parsing a value an unexpected character was encountered: A. Path 'badSyn', line 4, position 144.)
    ??????
     
  13. Have you edited the lang file?
     
  14. yes i m edited the lang file
     
  15. You have used a invalid character in the string with the key "badSyn"
     
  16. killyou is possible that some Player on my server ran this on chat: /helivote open
    and the server crashes?
    there is needed some update of the plugin?
     
  17. Shouldn't be related to this, probably just a coincidence
     
  18. OK I am trying two changes to the .cs file that are failing... I am a novice coder so this is escaping me why it will not work.

    First I want the helivote to fail if no one votes either way (this is how I think it should work but I guess we could create a config var like forceHeliOnNoVotes and if true will work as is but if false will fail if no votes)... anyway this is how I tried to do it:

    Code:
            private bool TallyVotes()
            {
                var Yes = receivedYes.Count;
                var No = receivedNo.Count;
                float requiredVotes = BasePlayer.activePlayerList.Count * requiredVotesPercentage;
                if (Yes > 0 || No > 0)
                {
                    if (useMajorityRules)
                        if (Yes >= No)
                            return true;
                    if (Yes > No && Yes >= requiredVotes) return true;
                }
                return false;
            }
    
    Take not that I wrapped the entire check in a " if (Yes > 0 || No > 0)" so that if no votes are cast then the vote fails. This has not worked. I tried many ways including " if (Yes <= 0 && No <= 0) return false;" at the same location without the wrapping.

    Nothing is working....


    OK second item... I am also trying to add the counts of the votes to the strings and cant.
    (all code abbreviated for succinctness)

    Original code:
    Code:
    string.Format(lang.GetMessage("timeLeft", this), 1, "Minute")
    
    I have tried updating the "timeleft" as follows:
    Code:
    {"timeLeft", "Voting ends in {0} {1}, use <color=#ff704d>/helivote yes ({2})</color> or <color=#ff704d>/helivote no ({3})</color>" },
    
    and the call code as follows:
    Code:
    string.Format(lang.GetMessage("timeLeft", this), 1, "Minute", receivedYes.Count, receivedN0.Count)
    
    I also tried this:
    Code:
    var yes = receivedYes.Count
    var no = receivedNo.Countstring.Format(lang.GetMessage("timeLeft", this), 1, "Minute",yes,no)
    
    Nothing is working ... in fact even though I get no compiler errors at first the string never even includes the parans where the yes and no values should be.... later i do get compiler errors (after a server reboot) but I failed to record them down.
     
  19. 1st
    Code:
    if (Yes == 0 && No == 0) return false // No need to wrap it in curly braces just return straight away if no votes
    2nd That should work, you will have to delete your lang file to erase the old messages
    Code:
    {"timeLeft", "Voting ends in {0} {1}, use <color=#ff704d>/helivote yes ({2})</color> or <color=#ff704d>/helivote no ({3})</color>" }, // Lang string
    msgAll(string.Format(lang.GetMessage("timeLeft", this), 2, "Minutes", receivedYes.Count, receivedNo.Count)); // With formatting