mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-03-16 02:29:59 +00:00
Merge done?
This commit is contained in:
@@ -357,15 +357,15 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
{
|
||||
if (caller!.CanTarget(player))
|
||||
{
|
||||
Who(caller, player, banManager, muteManager);
|
||||
Who(caller, player, _banManager, _muteManager);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
internal void Who(CCSPlayerController? caller, CCSPlayerController player, BanManager banManager = null, MuteManager muteManager = null)
|
||||
{
|
||||
banManager ??= new(dbConnectionString, Config);
|
||||
muteManager ??= new(dbConnectionString);
|
||||
banManager ??= new(_database, Config);
|
||||
muteManager ??= new(_database);
|
||||
|
||||
PlayerInfo playerInfo = new PlayerInfo
|
||||
{
|
||||
@@ -501,8 +501,6 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
[ConsoleCommand("css_gag")]
|
||||
[RequiresPermissions("@css/chat")]
|
||||
@@ -542,7 +540,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
internal void Gag(CCSPlayerController? caller, CCSPlayerController player, int time, string reason = null, MuteManager muteManager = null)
|
||||
{
|
||||
reason ??= "Unknown";
|
||||
muteManager ??= new(dbConnectionString);
|
||||
muteManager ??= new(_database);
|
||||
|
||||
PlayerInfo playerInfo = new PlayerInfo
|
||||
{
|
||||
@@ -558,10 +556,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
IpAddress = caller?.IpAddress?.Split(":")[0]
|
||||
};
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await muteManager.MutePlayer(playerInfo, adminInfo, reason, time);
|
||||
});
|
||||
Task.Run(async () => { await muteManager.MutePlayer(playerInfo, adminInfo, reason, time); });
|
||||
|
||||
if (TagsDetected)
|
||||
NativeAPI.IssueServerCommand($"css_tag_mute {player!.SteamID.ToString()}");
|
||||
@@ -573,7 +568,8 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
{
|
||||
AddTimer(time * 60, () =>
|
||||
{
|
||||
if (player == null || !player.IsValid || player.AuthorizedSteamID == null) return;
|
||||
if (player == null || !player.IsValid || player.AuthorizedSteamID == null)
|
||||
return;
|
||||
|
||||
if (TagsDetected)
|
||||
NativeAPI.IssueServerCommand($"css_tag_unmute {player!.SteamID.ToString()}");
|
||||
@@ -624,8 +620,6 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
[ConsoleCommand("css_addgag")]
|
||||
[RequiresPermissions("@css/chat")]
|
||||
@@ -885,7 +879,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
internal void Mute(CCSPlayerController? caller, CCSPlayerController player, int time, string reason = null, MuteManager muteManager = null)
|
||||
{
|
||||
reason ??= "Unknown";
|
||||
muteManager ??= new(dbConnectionString);
|
||||
muteManager ??= new(_database);
|
||||
|
||||
PlayerInfo playerInfo = new PlayerInfo
|
||||
{
|
||||
@@ -968,8 +962,6 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
[ConsoleCommand("css_addmute")]
|
||||
[RequiresPermissions("@css/chat")]
|
||||
@@ -1232,7 +1224,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
internal void Ban(CCSPlayerController? caller, CCSPlayerController player, int time, string reason = null, BanManager banManager = null)
|
||||
{
|
||||
reason ??= "Unknown";
|
||||
banManager ??= new(dbConnectionString, Config);
|
||||
banManager ??= new(_database, Config);
|
||||
|
||||
if (player.PawnIsAlive)
|
||||
{
|
||||
@@ -1254,10 +1246,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
IpAddress = caller?.IpAddress?.Split(":")[0]
|
||||
};
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await banManager.BanPlayer(playerInfo, adminInfo, reason, time);
|
||||
});
|
||||
Task.Run(async () => { await banManager.BanPlayer(playerInfo, adminInfo, reason, time); });
|
||||
|
||||
AddTimer(Config.KickTime, () => Helper.KickPlayer((ushort)player!.UserId!), CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE);
|
||||
|
||||
@@ -1294,8 +1283,6 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
[ConsoleCommand("css_addban")]
|
||||
[RequiresPermissions("@css/ban")]
|
||||
@@ -1542,7 +1529,6 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
[ConsoleCommand("css_give")]
|
||||
@@ -1779,8 +1765,6 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
[ConsoleCommand("css_team")]
|
||||
[RequiresPermissions("@css/kick")]
|
||||
@@ -1857,15 +1841,14 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
if (caller == null || caller != null && caller.UserId != null && !silentPlayers.Contains((ushort)caller.UserId))
|
||||
{
|
||||
StringBuilder sb = new(_localizer!["sa_prefix"]);
|
||||
sb.Append(_localizer["sa_admin_team_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName, _teamName]);
|
||||
sb.Append(_localizer["sa_admin_team_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName, teamName]);
|
||||
Server.PrintToChatAll(sb.ToString());
|
||||
if (Config.DiscordWebhook.Length > 0 && _localizer != null)
|
||||
{
|
||||
LocalizedString localizedMessage = _localizer["sa_admin_team_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName, _teamName];
|
||||
LocalizedString localizedMessage = _localizer["sa_admin_team_message", caller == null ? "Console" : caller.PlayerName, player.PlayerName, teamName];
|
||||
_ = SendWebhookMessage(localizedMessage.ToString().Replace("", "").Replace("", ""));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
[ConsoleCommand("css_vote")]
|
||||
|
||||
Reference in New Issue
Block a user