mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-09-27 20:17:04 +02:00
Update basecommands.cs
Separation of "RG" and "RR". > Requires review.
This commit is contained in:
parent
cce265c6b7
commit
f3b203ea10
1 changed files with 20 additions and 5 deletions
|
|
@ -637,17 +637,14 @@ namespace CS2_SimpleAdmin
|
||||||
Logger.LogInformation($"{callerName} executed command ({command.ArgString}).");
|
Logger.LogInformation($"{callerName} executed command ({command.ArgString}).");
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConsoleCommand("css_rr")]
|
|
||||||
[ConsoleCommand("css_rg")]
|
[ConsoleCommand("css_rg")]
|
||||||
[ConsoleCommand("css_restart")]
|
|
||||||
[ConsoleCommand("css_restartgame")]
|
[ConsoleCommand("css_restartgame")]
|
||||||
[RequiresPermissions("@css/generic")]
|
[RequiresPermissions("@css/generic")]
|
||||||
[CommandHelper(minArgs: 0, usage: "", whoCanExecute: CommandUsage.CLIENT_AND_SERVER)]
|
[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);
|
RestartGame(caller);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RestartGame(CCSPlayerController? admin)
|
public static void RestartGame(CCSPlayerController? admin)
|
||||||
{
|
{
|
||||||
Helper.LogCommand(admin, "css_restartgame");
|
Helper.LogCommand(admin, "css_restartgame");
|
||||||
|
|
@ -655,7 +652,25 @@ namespace CS2_SimpleAdmin
|
||||||
// TODO: Localize
|
// TODO: Localize
|
||||||
var name = admin == null ? "Console" : admin.PlayerName;
|
var name = admin == null ? "Console" : admin.PlayerName;
|
||||||
Server.PrintToChatAll($"[SA] {name}: Restarting game...");
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue