Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Prevent players from playing the game as invisible #129

Merged
merged 2 commits into from
Jul 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading