Skip to content

Commit

Permalink
add features
Browse files Browse the repository at this point in the history
  • Loading branch information
Griseo-bh3rd committed Aug 11, 2023
1 parent 024bdf8 commit 314f988
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions util/EventHandler.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//Copyright 2023 Silver Wolf,All Rights Reserved.
using Exiled.Events.EventArgs.Server;
using PluginAPI.Core;
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -28,26 +27,40 @@ public static void Register(bool value)
Exiled.Events.Handlers.Server.RoundStarted += Cleanup;
Exiled.Events.Handlers.Server.RestartingRound += Stopcleanup;
Exiled.Events.Handlers.Scp914.ChangingKnobSetting += Show914;
Exiled.Events.Handlers.Scp914.Activating += OnActivate914;
}
else
{
Exiled.Events.Handlers.Server.RoundStarted -= Cleanup;
Exiled.Events.Handlers.Server.RestartingRound -= Stopcleanup;
Exiled.Events.Handlers.Scp914.ChangingKnobSetting -= Show914;
Exiled.Events.Handlers.Scp914.Activating -= OnActivate914;
}
}
public static Player player;
public static void OnActivate914(ActivatingEventArgs ev)
{
if (Scp914.Scp914Controller.Singleton.KnobSetting == Scp914.Scp914KnobSetting.Rough)
{
ServerConsole.AddLog($"[Warning]{ev.Player.Nickname}({ev.Player.UserId})activated 914 as {Scp914.Scp914Controller.Singleton.KnobSetting} mode", ConsoleColor.Yellow);
return;
}
ServerConsole.AddLog($"{ev.Player.Nickname}({ev.Player.UserId})activated 914 as {Scp914.Scp914Controller.Singleton.KnobSetting} mode");
}

public static void Show914(ChangingKnobSettingEventArgs ev)
{
if (ev.KnobSetting == Scp914.Scp914KnobSetting.Rough)
{
ServerConsole.AddLog($"[Warning]{ev.Player.Nickname}({ev.Player.UserId})changes the 914 mode to {ev.KnobSetting}");
ServerConsole.AddLog($"[Warning]{ev.Player.Nickname}({ev.Player.UserId})changes the 914 mode to {ev.KnobSetting}",ConsoleColor.Yellow);
player = ev.Player;
return;
}
ServerConsole.AddLog($"{ev.Player.Nickname}({ev.Player.UserId})changes the 914 mode to {ev.KnobSetting}");
}

static bool Flag;
private static void Stopcleanup()
public static void Stopcleanup()
{
Timing.KillCoroutines(_cleanupcoroutine);
}
Expand Down

0 comments on commit 314f988

Please sign in to comment.