}
}
-void VoteCount()
+void VoteCount(float first_count)
{
// declarations
vote_accept_count = vote_reject_count = vote_abstain_count = 0;
vote_needed_of_voted = floor((vote_accept_count + vote_reject_count) * vote_factor_of_voted) + 1;
// are there any players at all on the server? it could be an admin vote
- if(vote_player_count == 0)
+ if(vote_player_count == 0 && first_count)
{
VoteSpam(0, -1, "yes"); // no players at all, just accept it
VoteAccept();
if(vote_endtime > 0) // a vote was called
if(time > vote_endtime) // time is up
{
- VoteCount();
+ VoteCount(FALSE);
}
return;
print_to(caller, "^1You abstained from your vote.");
caller.vote_selection = VOTE_SELECT_ABSTAIN;
msg_entity = caller;
- if(!autocvar_sv_vote_singlecount) { VoteCount(); }
+ if(!autocvar_sv_vote_singlecount) { VoteCount(FALSE); }
}
return;
bprint("\{1}^2* ^3", GetCallerName(vote_caller), "^2 calls a vote for ", vote_called_display, "\n");
if(autocvar_sv_eventlog) { GameLogEcho(strcat(":vote:vcall:", ftos(vote_caller.playerid), ":", vote_called_display)); }
Nagger_VoteChanged();
- VoteCount(); // needed if you are the only one
+ VoteCount(TRUE); // needed if you are the only one
}
return;
bprint("\{1}^2* ^3", GetCallerName(vote_caller), "^2 calls a vote to become ^3master^2.\n");
if(autocvar_sv_eventlog) { GameLogEcho(strcat(":vote:vcall:", ftos(vote_caller.playerid), ":", vote_called_display)); }
Nagger_VoteChanged();
- VoteCount(); // needed if you are the only one
+ VoteCount(TRUE); // needed if you are the only one
}
return;
print_to(caller, "^1You rejected the vote.");
caller.vote_selection = VOTE_SELECT_REJECT;
msg_entity = caller;
- if(!autocvar_sv_vote_singlecount) { VoteCount(); }
+ if(!autocvar_sv_vote_singlecount) { VoteCount(FALSE); }
}
return;
print_to(caller, "^1You accepted the vote.");
caller.vote_selection = VOTE_SELECT_ACCEPT;
msg_entity = caller;
- if(!autocvar_sv_vote_singlecount) { VoteCount(); }
+ if(!autocvar_sv_vote_singlecount) { VoteCount(FALSE); }
}
return;