From 4204298b3ee42e9a1fe0ed68e34b8ab268093a96 Mon Sep 17 00:00:00 2001 From: Resxt <55228336+Resxt@users.noreply.github.com> Date: Mon, 21 Mar 2022 16:58:09 +0100 Subject: [PATCH] camera_switch_vote_on_button_press 1.0.1 Changed "you voted" to player.name voted (fix) Changed enough votes message (fix) --- .../camera_switch_vote_on_button_press.gsc | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/actions_on_button_press/camera_switch_vote_on_button_press.gsc b/actions_on_button_press/camera_switch_vote_on_button_press.gsc index 484e5f0..662acf4 100644 --- a/actions_on_button_press/camera_switch_vote_on_button_press.gsc +++ b/actions_on_button_press/camera_switch_vote_on_button_press.gsc @@ -48,11 +48,11 @@ OnCameraSwitchVoteButtonPressed(button) self.pers["camera_switch_vote"] = !self.pers["camera_switch_vote"]; if (self.pers["camera_switch_vote"]) { - CustomPrintLn("You voted to switch the camera"); + CustomPrintLn(self.name + " voted to switch the camera"); } else { - CustomPrintLn("You removed your vote to switch the camera"); + CustomPrintLn(self.name + " removed his vote to switch the camera"); } } } @@ -76,20 +76,22 @@ DisplayVoteCount() foreach (player in level.players) { - if (isDefined(player.pers["isBot"])) - { - if (player.pers["isBot"]) - { - break; - } - } - if (player.pers["camera_switch_vote"]) { yes_votes++; } - human_players[human_players.size] = player; + if (!isDefined(player.pers["isBot"])) + { + human_players[human_players.size] = player; + } + else + { + if (!player.pers["isBot"]) + { + human_players[human_players.size] = player; + } + } } votes_required = 0; @@ -116,11 +118,11 @@ DisplayVoteCount() { if (getDvarInt( "camera_thirdPerson" ) == 0) { - CustomPrintLn("More than half of the players voted to switch to 1st person"); + CustomPrintLn("Switching to 1st person (+50% votes)"); } else { - CustomPrintLn("More than half of the players voted to switch to 3rd person"); + CustomPrintLn("Switching to 3rd person (+50% votes)"); } }