diff --git a/Commands/basecommands.cs b/Commands/basecommands.cs index 22331a0..d3901ef 100644 --- a/Commands/basecommands.cs +++ b/Commands/basecommands.cs @@ -642,17 +642,14 @@ public void OnRconCommand(CCSPlayerController? caller, CommandInfo command) Logger.LogInformation($"{callerName} executed command ({command.ArgString})."); } - [ConsoleCommand("css_rr")] [ConsoleCommand("css_rg")] - [ConsoleCommand("css_restart")] [ConsoleCommand("css_restartgame")] [RequiresPermissions("@css/generic")] [CommandHelper(minArgs: 0, usage: "", whoCanExecute: CommandUsage.CLIENT_AND_SERVER)] - public void OnRestartCommand(CCSPlayerController? caller, CommandInfo command) + public void OnRestartGameCommand(CCSPlayerController? caller, CommandInfo command) { RestartGame(caller); } - public static void RestartGame(CCSPlayerController? admin) { Helper.LogCommand(admin, "css_restartgame"); @@ -660,7 +657,25 @@ public static void RestartGame(CCSPlayerController? admin) // TODO: Localize var name = admin == null ? "Console" : admin.PlayerName; Server.PrintToChatAll($"[SA] {name}: Restarting game..."); - Server.ExecuteCommand("mp_restartgame 2"); + Server.ExecuteCommand("mp_restartgame 1"); + } + + [ConsoleCommand("css_rr")] + [ConsoleCommand("css_restartround")] + [RequiresPermissions("@css/generic")] + [CommandHelper(minArgs: 0, usage: "", whoCanExecute: CommandUsage.CLIENT_AND_SERVER)] + public void OnRestartRoundCommand(CCSPlayerController? caller, CommandInfo command) + { + RestartRound(caller); + } + public static void RestartRound(CCSPlayerController? admin) + { + Helper.LogCommand(admin, "css_restartround"); + + // TODO: Localize + var name = admin == null ? "Console" : admin.PlayerName; + Server.PrintToChatAll($"[SA] {name}: Restarting round..."); + Server.ExecuteCommand("sv_cheats 1; endround; sv_cheats 0"); // Lazy solution but works } } } \ No newline at end of file