added more countdown functionality

This commit is contained in:
2019-09-07 20:32:28 +02:00
parent bcb1fc6dce
commit 5dcea6e03b

View File

@@ -363,7 +363,22 @@ namespace ReallifeGamemode.Server.Commands
return; return;
} }
if (timer_string == "clear") int timer = int.Parse(timer_string);
foreach (Client c in NAPI.Pools.GetAllPlayers())
{
c.TriggerEvent("countdown", timer, text);
}
}
public void CmdCountdown(Client player, string text)
{
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
{
ChatService.NotAuthorized(player);
return;
}
if (text == "clear")
{ {
foreach (Client c in NAPI.Pools.GetAllPlayers()) foreach (Client c in NAPI.Pools.GetAllPlayers())
{ {
@@ -371,11 +386,11 @@ namespace ReallifeGamemode.Server.Commands
} }
} }
int timer = int.Parse(timer_string); int timer = int.Parse(text);
foreach (Client c in NAPI.Pools.GetAllPlayers()) foreach (Client c in NAPI.Pools.GetAllPlayers())
{ {
c.TriggerEvent("countdown", timer, text); c.TriggerEvent("countdown", timer, "");
} }
} }