X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fvote.qc;h=1fbdecad9fdf6714fff928c760ab9444eb140a35;hp=e67b5378073820b7815b4c428d000aec986b0237;hb=4fc59bbd7e2d4f25ba21952ed50ae754295a7faa;hpb=e97a2b023da3c3177d0292a4ad343e770a8ae71a diff --git a/qcsrc/server/vote.qc b/qcsrc/server/vote.qc index e67b537807..1fbdecad9f 100644 --- a/qcsrc/server/vote.qc +++ b/qcsrc/server/vote.qc @@ -129,6 +129,7 @@ void VoteDialog_Reset() { } float GameCommand_Vote(string s, entity e) { + local float playercount; float argc; argc = tokenize_console(s); if(argv(0) == "help") { @@ -161,8 +162,8 @@ float GameCommand_Vote(string s, entity e) { if(vote == "") { print_to(e, "^1Your vote is empty. See 'vhelp' for more info."); } else if(e - && time < e.vote_next) { - print_to(e, strcat("^1You have to wait ^2", ftos(ceil(e.vote_next - time)), "^1 seconds before you can again call a vote.")); + && time < e.vote_next) { + print_to(e, strcat("^1You have to wait ^2", ftos(ceil(e.vote_next - time)), "^1 seconds before you can again call a vote.")); } else if(VoteCheckNasty(vote)) { print_to(e, "Syntax error in command. See 'vhelp' for more info."); } else if(RemapVote(vote, "vcall", e)) { @@ -183,6 +184,14 @@ float GameCommand_Vote(string s, entity e) { Nagger_VoteChanged(); msg_entity = e; VoteDialog_UpdateHighlight(1); + + local entity player; + FOR_EACH_REALCLIENT(player) + { + ++playercount; + } + if(playercount > 1) // don't announce a "vote now" sound if player is alone + Announce("votecall"); } else { print_to(e, "^1This vote is not ok. See 'vhelp' for more info."); } @@ -486,16 +495,19 @@ void VoteAccept() { // no wait for next vote } VoteReset(); + Announce("voteaccept"); } void VoteReject() { bprint("\{1}^2* ^3", VoteNetname(votecaller), "^2's vote for ", votecalledvote_display, "^2 was rejected\n"); VoteReset(); + Announce("votefail"); } void VoteTimeout() { bprint("\{1}^2* ^3", VoteNetname(votecaller), "^2's vote for ", votecalledvote_display, "^2 timed out\n"); VoteReset(); + Announce("votefail"); } void VoteStop(entity stopper) {