View Single Post
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 06-21-2014 , 12:54   Re: [L4D2] Score/Team Manager 1.3.0
Reply With Quote #618

It's in this part

Code:
    else if (action == MenuAction_VoteEnd)
    {
        decl String:item[256], String:display[256], Float:percent;
        new votes, totalVotes;
        
        GetMenuVoteInfo(param2, votes, totalVotes);
        GetMenuItem(menu, param1, item, sizeof(item), _, display, sizeof(display));
        
        percent = GetVotePercent(votes, totalVotes);
        
        PrintToChatAll("Scramble vote successful: %s (Received %i%% of %i votes)", display, RoundToNearest(100.0*percent), totalVotes);
        
        new winner = StringToInt(item);
        if (winner) ScrambleTeams();
    }
item is a string with the vote absolute count winner, "1" for scramble or "0" if not.
Obviously the item = "1" case can be neglected for your change.
If item = "0" then (totalVotes - votes) is the number of people who voted "1".
So, your change would be :

Code:
if (winner || (totalVotes - votes) >= 5) ScrambleTeams();
AtomicStryker is offline