Skip to content

Commit

Permalink
fix: show change in scoreboard directly
Browse files Browse the repository at this point in the history
  • Loading branch information
derkalle4 committed Nov 8, 2024
1 parent d60c077 commit 150e6d2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/TeamBalancer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,28 @@ public HookResult OnPlayerTeam(EventPlayerTeam @event, GameEventInfo info)
&& score_t - score_ct >= 2)
{
player.ChangeTeam(CsTeam.CounterTerrorist);
// inform players
player.PrintToCenterAlert(Localizer["switch.to_ct_center"].Value
.Replace("{player}", player.PlayerName));
SendGlobalChatMessage(Localizer["switch.to_ct_chat"].Value
.Replace("{player}", player.PlayerName));
// update scoreboard
var @tmpEvent = new EventNextlevelChanged(true);
@tmpEvent.FireEvent(false);
}
else if (@event.Team == (byte)CsTeam.CounterTerrorist
&& count_t <= count_ct
&& score_ct - score_t >= 2)
{
player.ChangeTeam(CsTeam.Terrorist);
// inform players
player.PrintToCenterAlert(Localizer["switch.to_t_center"].Value
.Replace("{player}", player.PlayerName));
SendGlobalChatMessage(Localizer["switch.to_t_chat"].Value
.Replace("{player}", player.PlayerName));
// update scoreboard
var @tmpEvent = new EventNextlevelChanged(true);
@tmpEvent.FireEvent(false);
}
return HookResult.Continue;
}
Expand Down

0 comments on commit 150e6d2

Please sign in to comment.