Repository navigation
Home
SpGerg edited this page Sep 19, 2023
·
3 revisions
Welcome to the Statuses wiki!
The plugin allows you to create statuses. Statuses display some information in the form of primitives of different colors.
Creating status example:
public class LowHealthStatus : IStatus
{
public string Name => "Low health";
public PrimitiveType Primitive => PrimitiveType.Cube;
public Color Color => new Color(255, 0, 0);
public CategoryType Category => CategoryType.Negative;
}If you want your status to be used in EnableRandom method, register status:
API.Register<LowHealthStatus>();Enable and disable example:
private IEnumerator<float> CheckHealthCoroutine()
{
while (true)
{
foreach (var player in Exiled.API.Features.Player.List)
{
if (!player.IsAlive) continue;
if (player.Health < 35)
{
API.API.Enable<LowHealthStatus>(player);
}
else
{
API.API.Disable<LowHealthStatus>(player);
}
}
yield return Timing.WaitForOneFrame;
}
}