Skip to content
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
16 changes: 14 additions & 2 deletions src/AntiDLL.BanModule/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using CounterStrikeSharp.API.Core.Capabilities;

using AntiDLL.API;
using CounterStrikeSharp.API.Core.Attributes.Registration;

public sealed class Config : BasePluginConfig
{
Expand All @@ -22,7 +23,7 @@ public sealed class Plugin : BasePlugin, IPluginConfig<Config>
{
public override string ModuleName => "[AntiDLL] BanModule";

public override string ModuleVersion => "1.2";
public override string ModuleVersion => "1.3";

public override string ModuleAuthor => "verneri";

Expand Down Expand Up @@ -58,9 +59,20 @@ private void OnDetection(CCSPlayerController player, string eventName)

Server.ExecuteCommand(command);
base.Logger.LogInformation($"{this.Config.PunishmentType.ToUpper()}ED {player.PlayerName} for violating {eventName}");
}
}

[GameEventHandler]
public HookResult OnPlayerDisconnect(EventPlayerDisconnect @event, GameEventInfo info)
{
CCSPlayerController? player = @event.Userid;

AddTimer(10.0f, () => this.Punishedplayers.Remove(player.SteamID));
if (player != null && this.Punishedplayers.Contains(player.SteamID))
{
this.Punishedplayers.Remove(player.SteamID);
}

return HookResult.Continue;
}

public override void OnAllPluginsLoaded(bool hotReload)
Expand Down