#How to get an event when a player starts/finishes speaking

73 messages ยท Page 1 of 1 (latest)

oblique arch
#

๐Ÿ™‚

languid crystal
#

Look at PlayerVoice , if the event isnt static youll have to get it from the player instance Player.voice

oblique arch
#

And there is isTalking, but it is also not working.

languid crystal
#

Do you not know how events work?? @oblique arch

#

PlayerVoice.onRelayVoice += YourMethod;

oblique arch
#

Yes

oblique arch
oblique arch
#

@languid crystal Do you have any ideas how to solve this?

#

๐Ÿ˜ฆ

languid crystal
#

Move it to Load() in your plugin

oblique arch
languid crystal
#

From what other object?

oblique arch
#

There's only bool

languid crystal
#

Where??

oblique arch
#

in PlayerVoice.onRelayVoice

languid crystal
#

...

#

There are like 5 parameters

#

Set up your method correctly

#

Google how to use events in C#

oblique arch
#

I saw only one, and this bool

languid crystal
#

The delegate that the event uses clearly has all the information that you need

#

Set up your subscribed method properly

#

This is a you issue

hidden phoenix
# oblique arch ?

Do += methodthatdoesntexist and use visual studio "generate method", itl setup it correctly

#

Make sure to unsubscribe from the event on onUnload

oblique arch
#

But as far as I understand, he starts talking, or ends

languid crystal
#

Yes thats when that event triggers

oblique arch
hidden phoenix
#

if it exists id be in the same file

languid crystal
oblique arch
languid crystal
oblique arch
languid crystal
#

What information do you need that you dont have?

#

the player who stopped/started talking?

#

its an instance event, youll have to keep track of that

#

Easiest way would be to do:

U.Events.OnPlayerConnected += OnPlayerConnected;
// ...

private void OnPlayerConnected(UnturnedPlayer player)
{
    player.Player.voice.onTalkingChanged += (bool isTalking) => OnTalkingChanged(player, isTalking);
}

private void OnTalkingChanged(UnturnedPlayer player, bool isTalking)
{
    Rocket.Core.Logging.Logger.Log($"{player.DisplayName} talking state updated to {isTalking}!");
}
oblique arch
oblique arch
#

?

#

what this

#

about BWS griefer

oblique arch
#

:(((

#

all good

languid crystal
#

you could try emailing Nelson about it

#

Thats all client side

#

Plugins run server side

#

you cant modify the client using a plugin*

#

You cant overwrite that texture

#

its part of core.masterbundle

#

you can only ADD new stuff using workshop mods

#

The only way to disable it would be to make a client sided module that disables it

#

But that doesnt work for servers really

#

since that something youd have to install before hand

#

wdym?

languid crystal
#

You cant disable a texture

#

??

#

Like sure you can modify YOUR game files

#

but that will prevent you from joining multiplayer servers

#

But that wont modify anyone elses game files

#

Pretty sure Vanilla UI is rendered on top of Modded Workshop UI

#

hm or idk

#

unsure what elements are actually rendered on top