diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index a04dad50..ebcad395 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -355,7 +355,7 @@ namespace ReallifeGamemode.Server.Commands #region ALevel1 [Command("countdown", "~m~Benutzung: ~s~/countdown [Zeit] [Text]", GreedyArg = true)] - public void CmdCountdown(Client player, string timer_string, string text) + public void CmdAdminCountdown(Client player, string timer_string, string text) { if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true) { @@ -367,17 +367,18 @@ namespace ReallifeGamemode.Server.Commands { foreach (Client c in NAPI.Pools.GetAllPlayers()) { - c.TriggerEvent("countdown", 0, "ich liebe balbo"); + c.TriggerEvent("countdown", 0, ""); } return; } - int timer = int.Parse(timer_string); - - foreach (Client c in NAPI.Pools.GetAllPlayers()) + if(!int.TryParse(timer_string, out int timer)) { - c.TriggerEvent("countdown", timer, text); + ChatService.ErrorMessage(player, "Die Zeit muss eine Ganzzahl sein"); + return; } + + NAPI.ClientEvent.TriggerClientEventForAll("countdown", timer, text); } [Command("aunjail", "~m~Benutzung: ~s~/aunjail [Spieler]", GreedyArg = true)]