|
9 | 9 |
|
10 | 10 | namespace BasicAdmin;
|
11 | 11 |
|
12 |
| -public class BasicAdmin : BasePlugin, IPluginConfig<BasicAdminConfig> |
| 12 | +public sealed class BasicAdmin : BasePlugin, IPluginConfig<BasicAdminConfig> |
13 | 13 | {
|
14 | 14 | public override string ModuleName => "BasicAdmin";
|
15 | 15 | public override string ModuleAuthor => "livevilog";
|
@@ -47,6 +47,28 @@ public void OnMapCommand(CCSPlayerController? caller, CommandInfo info)
|
47 | 47 | });
|
48 | 48 | }
|
49 | 49 |
|
| 50 | + [ConsoleCommand("css_wsmap", "Change map.")] |
| 51 | + [ConsoleCommand("css_workshop", "Change map.")] |
| 52 | + [CommandHelper(1, "<mapid>")] |
| 53 | + [RequiresPermissions("@css/changemap")] |
| 54 | + public void OnWorkshopMapCommand(CCSPlayerController? caller, CommandInfo info) |
| 55 | + { |
| 56 | + var map = info.GetArg(1); |
| 57 | + |
| 58 | + if (!Server.IsMapValid(map)) |
| 59 | + { |
| 60 | + info.ReplyToCommand(FormatMessage($"Map {map} not found.")); |
| 61 | + return; |
| 62 | + } |
| 63 | + |
| 64 | + Server.PrintToChatAll(FormatAdminMessage($"Changing map to {map}...")); |
| 65 | + |
| 66 | + AddTimer(3f, () => |
| 67 | + { |
| 68 | + Server.ExecuteCommand($"ds_workshop_changelevel {map}"); |
| 69 | + }); |
| 70 | + } |
| 71 | + |
50 | 72 | [ConsoleCommand("css_kick", "Kick a player from the server.")]
|
51 | 73 | [CommandHelper(1, "<#userid or name> [reason]")]
|
52 | 74 | [RequiresPermissions("@css/kick")]
|
@@ -204,7 +226,7 @@ public void OnAdminHudSayCommand(CCSPlayerController? caller, CommandInfo info)
|
204 | 226 | 0, 0, 0, 0);
|
205 | 227 | }
|
206 | 228 |
|
207 |
| - [ConsoleCommand("css_extend", "Respawn a dead player.")] |
| 229 | + [ConsoleCommand("css_extend", "Extend map timelimit.")] |
208 | 230 | [CommandHelper(1, "<minutes>")]
|
209 | 231 | [RequiresPermissions("@css/changemap")]
|
210 | 232 | public void OnExtendCommand(CCSPlayerController? caller, CommandInfo info)
|
|
0 commit comments