Added css_wsmap

- css_wsmap <name or id> - Change workshop map // @css/changemap
This commit is contained in:
daffyyyy
2023-12-03 21:18:43 +01:00
parent f19c594568
commit 696b8c3877
3 changed files with 21 additions and 1 deletions

View File

@@ -522,6 +522,25 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
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, "<name or id>")]
[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, "<message>")]
[RequiresPermissions("@css/chat")]

View File

@@ -46,7 +46,7 @@ namespace CS2_SimpleAdmin
"- css_banip <ip> [time in minutes/0 perm] [reason] - Ban player via IP address\n- css_unban <steamid or name or ip> - 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 <steamid> [time in minutes/0 perm] [reason] - Gag player via steamid64\n" +
"- css_unmute <steamid or name> <type [gag/mute] - Unmute player\n" +
"- css_slay <#userid or name> - Kill player\n- css_slap <#userid or name> [damage] - Slap player\n- css_map <mapname> - Change map\n- css_say <message> - 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 <mapname> - Change map\n- css_wsmap <name or id> - Change workshop map\n- css_say <message> - Say message as admin in chat\n" +
"- css_psay <#userid or name> <message> - Sends private message to player\n- css_csay <message> - Say message as admin in center\n- css_hsay <message> - 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 <cvar> <value> - Change cvar value\n- css_rcon <command> - Run command as server";

View File

@@ -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 <mapname> - Change map // @css/changemap
- css_wsmap <name or id> - Change workshop map // @css/changemap
- css_say <message> - Say message as admin in chat // @css/chat
- css_psay <#userid or name> <message> - Sends private message to player // @css/chat
- css_csay <message> - Say message as admin in center // @css/chat