Rust: Global Voice Chat (Admin only)

Hi!
This is more like a question instead of a real request.
I just want to know - if it's even possible - to create a plugin that allows admins to say something in a global voice chat that everyone on the map can hear and how difficult it is to make such a plugin.

If it is possible and not too difficult to make, I may have interest in such a thing.

Thanks!

Voice proximity is hard coded. Not possible atm. 

This can be achieved, but only in a hack way, by spawning players or speakers near every player, to broadcast the audio to them.

NKXTQs24ExGTuL8.jpg WhiteThunder

This can be achieved, but only in a hack way, by spawning players or speakers near every player, to broadcast the audio to them.

As of second thought, this is practical though what about re-writing the net code changing the radius to 9999f for example. 

        public object OnPlayerVoice(BasePlayer player, byte[] data)
        {
            if (player.IsAdmin && Network.Net.sv.write.Start())
            {
                Network.Net.sv.write.PacketID(Message.Type.VoiceData);
                Network.Net.sv.write.UInt32(player.net.ID);
                Network.Net.sv.write.BytesWithSize(data);
                Network.Net.sv.write.Send(new SendInfo(BaseNetworkable.GetConnectionsWithin(player.transform.position, 9999f)) { 
                    priority = Priority.Immediate
                });
                return false;
            }
            return null;
        }

 

 

Possible issues with that approach are that clients may not necessarily play the audio if they detect that it's coming from an entity that is too far away (needs testing to confirm), and clients will not play the audio if the source entity is not networked to them (so you would have to network the source entity to them forcibly).

stupid question

where is this Class from "

Network.Net​
"
gLhKjcF6YJmheax.png NooBlet

stupid question

where is this Class from "

Network.Net​
"
Assembly-CSharp-firstpass
NKXTQs24ExGTuL8.jpg WhiteThunder

Possible issues with that approach are that clients may not necessarily play the audio if they detect that it's coming from an entity that is too far away (needs testing to confirm), and clients will not play the audio if the source entity is not networked to them (so you would have to network the source entity to them forcibly).

You are correct the client blocks it because its not networked to them (to far away)