Skip to content

Commit

Permalink
Merge pull request #129 from SpirTBBX/ghost-player-fix
Browse files Browse the repository at this point in the history
fix: Prevent players from playing the game as invisible
  • Loading branch information
B3none authored Jul 14, 2024
2 parents 00f9bc2 + 4446e75 commit e2c5c3b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions RetakesPlugin/RetakesPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.7";

#region Plugin info
public override string ModuleName => "Retakes Plugin";
Expand Down Expand Up @@ -510,7 +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.
player.TeamNum = (int)CsTeam.Spectator;
player.ForceTeamTime = 3600.0f;

// Create a timer to do this as it would occasionally fire too early.
Expand All @@ -521,6 +520,7 @@ public HookResult OnPlayerConnectFull(EventPlayerConnectFull @event, GameEventIn
return;
}

player.ChangeTeam(CsTeam.Spectator);
player.ExecuteClientCommand("teammenu");
});

Expand Down Expand Up @@ -638,7 +638,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)
{
Expand Down

0 comments on commit e2c5c3b

Please sign in to comment.