mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-17 10:31:01 +00:00
1.3.0e
- Added `css_sa_upgrade` command
This commit is contained in:
@@ -48,7 +48,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
public override string ModuleName => "CS2-SimpleAdmin";
|
||||
public override string ModuleDescription => "Simple admin plugin for Counter-Strike 2 :)";
|
||||
public override string ModuleAuthor => "daffyy";
|
||||
public override string ModuleVersion => "1.3.0d";
|
||||
public override string ModuleVersion => "1.3.0e";
|
||||
|
||||
public CS2_SimpleAdminConfig Config { get; set; } = new();
|
||||
|
||||
@@ -121,6 +121,34 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
_localizer = Localizer;
|
||||
}
|
||||
|
||||
[ConsoleCommand("css_sa_upgrade")]
|
||||
[CommandHelper(whoCanExecute: CommandUsage.SERVER_ONLY)]
|
||||
public void OnSaUpgradeCommand(CCSPlayerController? caller, CommandInfo command)
|
||||
{
|
||||
if (caller != null || _database == null) return;
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError($"{ex.Message}");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
[ConsoleCommand("css_admin")]
|
||||
[RequiresPermissions("@css/generic")]
|
||||
public void OnAdminCommand(CCSPlayerController? caller, CommandInfo command)
|
||||
|
||||
@@ -30,6 +30,9 @@ Manage your Counter-Strike 2 server by simple commands :)
|
||||
- css_mute <#userid or name> [time in minutes/0 perm] [reason] - Mute player // @css/chat
|
||||
- css_addmute <steamid> [time in minutes/0 perm] [reason] - Mute player via steamid64 // @css/chat
|
||||
- css_unmute <steamid or name> - Unmute player // @css/chat
|
||||
- css_silence <#userid or name> [time in minutes/0 perm] [reason] - Silence player // @css/chat
|
||||
- css_addsilence <steamid> [time in minutes/0 perm] [reason] - Silence player via steamid64 // @css/chat
|
||||
- css_unsilence <steamid or name> - Unsilence player // @css/chat
|
||||
- css_give <#userid or name> <weapon> - Give weapon to player // @css/cheats
|
||||
- css_strip <#userid or name> - Takes all of the player weapons // @css/slay
|
||||
- css_hp <#userid or name> [health] - Set player health // @css/slay
|
||||
@@ -49,6 +52,7 @@ Manage your Counter-Strike 2 server by simple commands :)
|
||||
- css_noclip <#userid or name> - Toggle noclip for player // @css/cheats
|
||||
- css_freeze <#userid or name> [duration] - Freeze player // @css/slay
|
||||
- css_unfreeze <#userid or name> - Unfreeze player // @css/slay
|
||||
- css_rename <#userid or name> <new name> - Rename player // @css/kick
|
||||
- css_respawn <#userid or name> - Respawn player // @css/cheats
|
||||
- css_cvar <cvar> <value> - Change cvar value // @css/cvar
|
||||
- css_rcon <command> - Run command as server // @css/rcon
|
||||
@@ -58,7 +62,7 @@ Manage your Counter-Strike 2 server by simple commands :)
|
||||
```
|
||||
|
||||
### Requirments
|
||||
- [CounterStrikeSharp](https://github.com/roflmuffin/CounterStrikeSharp/) **tested on v159**
|
||||
- [CounterStrikeSharp](https://github.com/roflmuffin/CounterStrikeSharp/) **tested on v163**
|
||||
- MySQL **tested on MySQL (MariaDB) Server version: 10.11.4-MariaDB-1~deb12u1 Debian 12**
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ CREATE TABLE IF NOT EXISTS `sa_mutes` (
|
||||
`duration` int(11) NOT NULL,
|
||||
`ends` timestamp NOT NULL,
|
||||
`created` timestamp NOT NULL,
|
||||
`type` enum('GAG','MUTE','') NOT NULL DEFAULT 'GAG',
|
||||
`type` enum('GAG','MUTE','SILENCE','') NOT NULL DEFAULT 'GAG',
|
||||
`server_id` INT NULL,
|
||||
`status` enum('ACTIVE','UNMUTED','EXPIRED','') NOT NULL DEFAULT 'ACTIVE',
|
||||
PRIMARY KEY (`id`)
|
||||
|
||||
Reference in New Issue
Block a user