diff --git a/CS2-SimpleAdmin.cs b/CS2-SimpleAdmin.cs index a1def61..348985d 100644 --- a/CS2-SimpleAdmin.cs +++ b/CS2-SimpleAdmin.cs @@ -522,6 +522,25 @@ public void OnMapCommand(CCSPlayerController? caller, CommandInfo command) Server.PrintToChatAll(Helper.ReplaceTags($" {Config.Prefix} {Config.Messages.AdminChangeMap}".Replace("{ADMIN}", caller?.PlayerName == null ? "Console" : caller.PlayerName).Replace("{MAP}", map))); } + [ConsoleCommand("css_wsmap", "Change workshop map.")] + [ConsoleCommand("css_workshop", "Change workshop map.")] + [CommandHelper(1, "")] + [RequiresPermissions("@css/changemap")] + public void OnWorkshopMapCommand(CCSPlayerController? caller, CommandInfo command) + { + string? _command = null; + var map = command.GetArg(1); + + _command = ulong.TryParse(map, out var mapId) ? $"host_workshop_map {mapId}" : $"ds_workshop_changelevel {map}"; + + Server.PrintToChatAll(Helper.ReplaceTags($" {Config.Prefix} {Config.Messages.AdminChangeMap}".Replace("{ADMIN}", caller?.PlayerName == null ? "Console" : caller.PlayerName).Replace("{MAP}", map))); + + AddTimer(5f, () => + { + Server.ExecuteCommand(_command); + }); + } + [ConsoleCommand("css_say", "Say to all players.")] [CommandHelper(1, "")] [RequiresPermissions("@css/chat")] diff --git a/Config.cs b/Config.cs index 4967edd..d9210b3 100644 --- a/Config.cs +++ b/Config.cs @@ -46,7 +46,7 @@ public class Messages "- css_banip [time in minutes/0 perm] [reason] - Ban player via IP address\n- css_unban - Unban player\n" + "- css_kick <#userid or name> [reason] - Kick player\n- css_gag <#userid or name> [time in minutes/0 perm] [reason] - Gag player\n- css_addgag [time in minutes/0 perm] [reason] - Gag player via steamid64\n" + "- css_unmute - Kill player\n- css_slap <#userid or name> [damage] - Slap player\n- css_map - Change map\n- css_say - Say message as admin in chat\n" + + "- css_slay <#userid or name> - Kill player\n- css_slap <#userid or name> [damage] - Slap player\n- css_map - Change map\n- css_wsmap - Change workshop map\n- css_say - Say message as admin in chat\n" + "- css_psay <#userid or name> - Sends private message to player\n- css_csay - Say message as admin in center\n- css_hsay - Say message as admin in hud\n" + "- css_noclip <#userid or name> - Toggle noclip for player\n- css_freeze <#userid or name> [duration] - Freeze player\n- css_unfreeze <#userid or name> - Unfreeze player\n" + "- css_respawn <#userid or name> - Respawn player\n- css_cvar - Change cvar value\n- css_rcon - Run command as server"; diff --git a/README.md b/README.md index e777e66..6ecb7aa 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ It's only plugin base, I don't have much time for more extensive development, so - css_slay <#userid or name> - Kill player // @css/slay - css_slap <#userid or name> [damage] - Slap player // @css/slay - css_map - Change map // @css/changemap +- css_wsmap - Change workshop map // @css/changemap - css_say - Say message as admin in chat // @css/chat - css_psay <#userid or name> - Sends private message to player // @css/chat - css_csay - Say message as admin in center // @css/chat