- Added custom command to menu
- Better ungag/unmute/unsilence handling
- Fixed css_psay from console
This commit is contained in:
Dawid Bepierszcz
2024-03-02 22:16:38 +01:00
parent 7d5166cf4b
commit da6fb2fc22
8 changed files with 87 additions and 53 deletions

View File

@@ -29,9 +29,11 @@ namespace CS2_SimpleAdmin
using var connection = await _database.GetConnectionAsync();
var commandText = "ALTER TABLE `sa_mutes` CHANGE `type` `type` ENUM('GAG','MUTE', 'SILENCE', '') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'GAG';";
using var command = connection.CreateCommand();
command.CommandText = commandText;
await command.ExecuteNonQueryAsync();
using var commandSql = connection.CreateCommand();
commandSql.CommandText = commandText;
await commandSql.ExecuteNonQueryAsync();
command.ReplyToCommand("Successfully updated the database");
}
catch (Exception ex)
{
@@ -42,7 +44,7 @@ namespace CS2_SimpleAdmin
[ConsoleCommand("css_admin")]
[RequiresPermissions("@css/generic")]
[CommandHelper(minArgs: 0, usage: "", whoCanExecute: CommandUsage.CLIENT_ONLY)]
[CommandHelper(whoCanExecute: CommandUsage.CLIENT_ONLY)]
public void OnAdminCommand(CCSPlayerController? caller, CommandInfo command)
{
if (caller == null || caller.IsValid == false)