Skip to content

Commit

Permalink
some fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoniofo committed Jul 31, 2024
1 parent 53fc026 commit 8701a2e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public class Plugin : Plugin<Config>

public override Version Version => new Version(2, 0, 0);

public override Version RequiredExiledVersion => new Version(8, 11, 0);

public override string Prefix => "audioplayer";

public static List<ReferenceHub> AudioPlayers = new List<ReferenceHub>();
Expand All @@ -31,8 +33,7 @@ public class Plugin : Plugin<Config>
public List<string> MutedAnnounce;

public override void OnEnabled()
{
base.OnEnabled();
{
SCPSLAudioApi.Startup.SetupDependencies();
Plugin.instance = this;
MutedAnnounce = new List<string>();
Expand All @@ -41,18 +42,19 @@ public override void OnEnabled()
Exiled.Events.Handlers.Map.AnnouncingNtfEntrance += OnNTFAnnounce;
Exiled.Events.Handlers.Server.RoundStarted += OnRoundStart;
Exiled.Events.Handlers.Player.Verified += OnVerified;
base.OnEnabled();
}

public override void OnDisabled()
{
base.OnDisabled();
{
Plugin.instance = null;
MutedAnnounce = null;
Exiled.Events.Handlers.Server.RespawningTeam -= OnRespawnTeam;
SCPSLAudioApi.AudioCore.AudioPlayerBase.OnFinishedTrack -= OnFinishedTrack;
Exiled.Events.Handlers.Map.AnnouncingNtfEntrance -= OnNTFAnnounce;
Exiled.Events.Handlers.Server.RoundStarted -= OnRoundStart;
Exiled.Events.Handlers.Player.Verified -= OnVerified;
base.OnDisabled();
}

private void OnRoundStart()
Expand All @@ -74,9 +76,9 @@ private void OnVerified(VerifiedEventArgs ev)
}
}
else
{
{
playerRepo.InsertPlayer(new PlayerDB() { UserId = ev.Player.UserId, Mute = 1 });
}
}
}
}

Expand Down

0 comments on commit 8701a2e

Please sign in to comment.