Skip to content

Commit

Permalink
Added additional logs and updated getplayers to only get players that…
Browse files Browse the repository at this point in the history
… are connected
  • Loading branch information
B3none committed Jan 6, 2024
1 parent 75f00bf commit 610be3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion RetakesPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ public HookResult OnPlayerConnectFull(EventPlayerConnectFull @event, GameEventIn
player.TeamNum = (int)CsTeam.Spectator;
player.ForceTeamTime = 3600.0f;

if (Utilities.GetPlayers().ToList().Count <= 2)
Console.WriteLine($"{LogPrefix}OnPlayerConnectFull event fired. {Utilities.GetPlayers().ToList().Count} players connected.");
if (Utilities.GetPlayers().Where(Helpers.IsPlayerConnected).ToList().Count <= 2)
{
Console.WriteLine($"{LogPrefix}First or second player connected, resetting game.");
Helpers.RestartGame();
Expand Down

0 comments on commit 610be3e

Please sign in to comment.