From fda57e357f73f8a2d8b138b2b8972abec8e584d4 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Thu, 11 Jul 2024 21:51:38 +0100 Subject: [PATCH 1/2] fix: Prevent players from playing the game as invisible --- RetakesPlugin/RetakesPlugin.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/RetakesPlugin/RetakesPlugin.cs b/RetakesPlugin/RetakesPlugin.cs index f7466fa..9231775 100644 --- a/RetakesPlugin/RetakesPlugin.cs +++ b/RetakesPlugin/RetakesPlugin.cs @@ -20,7 +20,7 @@ namespace RetakesPlugin; [MinimumApiVersion(220)] public class RetakesPlugin : BasePlugin { - private const string Version = "2.0.6"; + private const string Version = "2.0.6.1"; #region Plugin info public override string ModuleName => "Retakes Plugin"; @@ -510,7 +510,10 @@ public HookResult OnPlayerConnectFull(EventPlayerConnectFull @event, GameEventIn } // TODO: We can make use of sv_human_autojoin_team 3 to prevent needing to do this. - player.TeamNum = (int)CsTeam.Spectator; + + //This was commented out as it causes the player to be able to join as spectator stay playing with xray until he's killed. + //Players that use this bug are not seen by other players. To fix this, we force the player to join as spectator by default + //player.TeamNum = (int)CsTeam.Spectator; player.ForceTeamTime = 3600.0f; // Create a timer to do this as it would occasionally fire too early. @@ -521,6 +524,7 @@ public HookResult OnPlayerConnectFull(EventPlayerConnectFull @event, GameEventIn return; } + player.ChangeTeam(CsTeam.Spectator); player.ExecuteClientCommand("teammenu"); }); @@ -638,7 +642,6 @@ public HookResult OnRoundPostStart(EventRoundPoststart @event, GameEventInfo inf Helpers.Debug($"Game manager not loaded."); return HookResult.Continue; } - // If we are in warmup, skip. if (Helpers.GetGameRules().WarmupPeriod) { From 4446e75b7cacb8587bc08eebc430cd038944c87e Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Sun, 14 Jul 2024 13:56:32 +0100 Subject: [PATCH 2/2] ref: version and comment refactor for pull request --- RetakesPlugin/RetakesPlugin.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/RetakesPlugin/RetakesPlugin.cs b/RetakesPlugin/RetakesPlugin.cs index 9231775..6748d48 100644 --- a/RetakesPlugin/RetakesPlugin.cs +++ b/RetakesPlugin/RetakesPlugin.cs @@ -20,7 +20,7 @@ namespace RetakesPlugin; [MinimumApiVersion(220)] public class RetakesPlugin : BasePlugin { - private const string Version = "2.0.6.1"; + private const string Version = "2.0.7"; #region Plugin info public override string ModuleName => "Retakes Plugin"; @@ -510,10 +510,6 @@ public HookResult OnPlayerConnectFull(EventPlayerConnectFull @event, GameEventIn } // TODO: We can make use of sv_human_autojoin_team 3 to prevent needing to do this. - - //This was commented out as it causes the player to be able to join as spectator stay playing with xray until he's killed. - //Players that use this bug are not seen by other players. To fix this, we force the player to join as spectator by default - //player.TeamNum = (int)CsTeam.Spectator; player.ForceTeamTime = 3600.0f; // Create a timer to do this as it would occasionally fire too early.