Skip to content

Commit

Permalink
Added css_wsmap
Browse files Browse the repository at this point in the history
- css_wsmap <name or id> - Change workshop map // @css/changemap
  • Loading branch information
daffyyyy committed Dec 3, 2023
1 parent f19c594 commit 696b8c3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
19 changes: 19 additions & 0 deletions CS2-SimpleAdmin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<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")]
Expand Down
2 changes: 1 addition & 1 deletion Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class Messages
"- 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";
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 696b8c3

Please sign in to comment.