mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-19 02:51:51 +00:00
1.3.9a
**MAJOR UPDATE** - New database schema - Added `css_admins_flags` table - Added `css_unmutes` table - Added `css_unbans` table
This commit is contained in:
@@ -371,12 +371,14 @@ namespace CS2_SimpleAdmin
|
||||
|
||||
[ConsoleCommand("css_unban")]
|
||||
[RequiresPermissions("@css/unban")]
|
||||
[CommandHelper(minArgs: 1, usage: "<steamid or name or ip>", whoCanExecute: CommandUsage.CLIENT_AND_SERVER)]
|
||||
[CommandHelper(minArgs: 1, usage: "<steamid or name or ip> [reason]", whoCanExecute: CommandUsage.CLIENT_AND_SERVER)]
|
||||
public void OnUnbanCommand(CCSPlayerController? caller, CommandInfo command)
|
||||
{
|
||||
if (_database == null) return;
|
||||
|
||||
string callerName = caller == null ? "Console" : caller.PlayerName;
|
||||
string callerName = caller?.PlayerName ?? "Console";
|
||||
string callerSteamId = caller?.SteamID.ToString() ?? "Console";
|
||||
|
||||
if (command.GetArg(1).Length <= 1)
|
||||
{
|
||||
command.ReplyToCommand($"Too short pattern to search.");
|
||||
@@ -384,9 +386,10 @@ namespace CS2_SimpleAdmin
|
||||
}
|
||||
|
||||
string pattern = command.GetArg(1);
|
||||
string reason = command.GetArg(2);
|
||||
|
||||
BanManager _banManager = new(_database, Config);
|
||||
Task.Run(async () => await _banManager.UnbanPlayer(pattern));
|
||||
Task.Run(async () => await _banManager.UnbanPlayer(pattern, callerSteamId, reason));
|
||||
|
||||
Helper.SendDiscordLogMessage(caller, command, _discordWebhookClientLog, _localizer);
|
||||
Helper.LogCommand(caller, command);
|
||||
|
||||
Reference in New Issue
Block a user