improve countdown
This commit is contained in:
@@ -355,7 +355,7 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
#region ALevel1
|
#region ALevel1
|
||||||
|
|
||||||
[Command("countdown", "~m~Benutzung: ~s~/countdown [Zeit] [Text]", GreedyArg = true)]
|
[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)
|
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||||
{
|
{
|
||||||
@@ -367,17 +367,18 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
{
|
{
|
||||||
foreach (Client c in NAPI.Pools.GetAllPlayers())
|
foreach (Client c in NAPI.Pools.GetAllPlayers())
|
||||||
{
|
{
|
||||||
c.TriggerEvent("countdown", 0, "ich liebe balbo");
|
c.TriggerEvent("countdown", 0, "");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int timer = int.Parse(timer_string);
|
if(!int.TryParse(timer_string, out int timer))
|
||||||
|
|
||||||
foreach (Client c in NAPI.Pools.GetAllPlayers())
|
|
||||||
{
|
{
|
||||||
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)]
|
[Command("aunjail", "~m~Benutzung: ~s~/aunjail [Spieler]", GreedyArg = true)]
|
||||||
|
|||||||
Reference in New Issue
Block a user