#ScpProximityChat Dev
28 messages · Page 1 of 1 (latest)
public class ScpChatHintPlugin : Plugin<Config>
{
private CoroutineHandle _coroutineHandle;
public override void OnEnabled()
{
Exiled.Events.Handlers.Player.Verified += OnPlayerVerified;
Exiled.Events.Handlers.Player.Destroying += OnPlayerDestroying;
_coroutineHandle = Timing.RunCoroutine(UpdateHintDisplay().CancelWith(this));
base.OnEnabled();
}
public override void OnDisabled()
{
Exiled.Events.Handlers.Player.Verified -= OnPlayerVerified;
Exiled.Events.Handlers.Player.Destroying -= OnPlayerDestroying;
Timing.KillCoroutines(_coroutineHandle);
base.OnDisabled();
}
private void OnPlayerVerified(VerifiedEventArgs ev)
{
if (ScpProximityChatAPI.IsScp(ev.Player))
{
ShowChatHint(ev.Player);
}
}
private void OnPlayerDestroying(DestroyingEventArgs ev)
{
if (ScpProximityChatAPI.IsScp(ev.Player))
{
ev.Player.ClearBroadcasts();
}
}
private IEnumerator<float> UpdateHintDisplay()
{
while (true)
{
foreach (Player player in Player.List)
{
if (ScpProximityChatAPI.IsScp(player))
{
ShowChatHint(player);
}
}
yield return Timing.WaitForSeconds(1f);
}
}
private void ShowChatHint(Player player)
{
string chatType = ScpProximityChatAPI.IsPlayerUsingProximityChat(player) ? "Proximity Chat" : "SCP Chat";
player.ShowHint($"<b><color=#42f57b>{chatType}</color></b>", 1f);
}
}
true
theres also RoleTypeId.GetTeam() == Team.SCPs
wait
ok
ok, I'll do it later I have to work.
i remember a plugin that someone made that used dummies to transmit audio or whatnot
making a way for scps not to appear on global chat and sound like actual people
maybe it was done through nwapi but i'm learning how to make plugins too.
Anyway. I'm not sure of any servers that use this, but do with this what you may will
:]
I know.
I don't care, I programmed the plugin because I needed it. I sometimes share my project with the public
¯_(ツ)_/¯
that's fine
is it working
I know
i dont say its working, i asked is it working or not working?
it works