refactor
This commit is contained in:
@@ -6,7 +6,7 @@ using MEC;
|
||||
|
||||
namespace ServerHints;
|
||||
|
||||
public class ServerHints: Plugin
|
||||
public class ServerHints : Plugin
|
||||
{
|
||||
public override string Name => "ServerHints";
|
||||
public override string Author => "Code002Lover";
|
||||
@@ -25,7 +25,7 @@ public class ServerHints: Plugin
|
||||
"Man kann Türen aufschießen",
|
||||
"Wenn man Granaten anschießt, explodieren sie sofort."
|
||||
];
|
||||
|
||||
|
||||
public override void Enable()
|
||||
{
|
||||
ServerEvents.RoundStarted += OnRoundStarted;
|
||||
@@ -36,16 +36,14 @@ public class ServerHints: Plugin
|
||||
{
|
||||
ServerEvents.RoundStarted -= OnRoundStarted;
|
||||
}
|
||||
|
||||
private void OnRoundStarted()
|
||||
{
|
||||
var random = new Random();
|
||||
var hint = Hints[random.Next(Hints.Length)];
|
||||
Timing.CallDelayed(1, () =>
|
||||
{
|
||||
foreach (var player in Player.ReadyList)
|
||||
{
|
||||
player.SendBroadcast($"<color=grey>{hint}</color>", 3);
|
||||
}
|
||||
foreach (var player in Player.ReadyList) player.SendBroadcast($"<color=grey>{hint}</color>", 3);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -26,21 +26,15 @@
|
||||
<Reference Include="Assembly-CSharp-firstpass">
|
||||
<HintPath>..\dependencies\Assembly-CSharp-firstpass.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mirror">
|
||||
<HintPath>..\dependencies\Mirror.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NorthwoodLib">
|
||||
<HintPath>..\dependencies\NorthwoodLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Pooling">
|
||||
<HintPath>..\dependencies\Pooling.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>..\dependencies\UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Northwood.LabAPI" Version="1.0.2" />
|
||||
<PackageReference Include="Northwood.LabAPI" Version="1.0.2"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user