Example #1
0
        void cmdVoteTime(BasePlayer player, string command, string[] args)
        {
            if (votePoll == null)
            {
                SendReply(player, "No poll is open at this time.");
                return;
            }

            var checkVote = votePoll.voteDay(player);

            if (!checkVote)
            {
                return;             // don't go further if the player has voted
            }
            checkVotes();
            if (displayVoteProgress)
            {
                if (votePoll != null)
                {
                    int   totalPlayers = BasePlayer.activePlayerList.Count;
                    int   votes        = votePoll.tallyVotes();
                    float percent      = (float)votes / totalPlayers;
                    MessageAllPlayers(string.Format("Vote progress: {0} / {1} ({2}%/{3}%)", votes, totalPlayers, (int)(percent * 100), (int)(requiredVotesPercentage * 100)));
                }
            }
        }
Example #2
0
        void cmdVoteTime(BasePlayer player, string command, string[] args)
        {
            if (votePoll == null)
            {
                SendReply(player, noPollOpen);
                return;
            }

            var checkVote = votePoll.voteDay(player);

            if (!checkVote)
            {
                SendReply(player, alreadyVoted);
                return; // don't go further if the player has voted
            }
            checkVotes();
            if (displayVoteProgress)
            {
                if (votePoll != null)
                {
                    int   totalPlayers = BasePlayer.activePlayerList.Count;
                    int   votes        = votePoll.tallyVotes();
                    float percent      = (float)votes / totalPlayers;
                    MessageAllPlayers(string.Format(voteProgress, votes, totalPlayers, (int)(percent * 100), (int)(requiredVotesPercentage * 100)));
                }
            }
        }