Sending a sound effect to specific player?
Hi, I'm modifying a PM plugin, not from uMod, I'm trying to play a sound effect client-side only on the player that received the PM, with this code (Effect.server.Run) both sender and receiver get the sound effect and I believe it's not client-side so everyone around them should be able to hear.
private void PrintMessage(BasePlayer player, string msgId, params object[] args)
{
    PrintToChat(player, lang.GetMessage(msgId, this, player.UserIDString), args);
    Effect.server.Run("assets/bundled/prefabs/fx/invite_notice.prefab", player.GetNetworkPosition());
}​
I only added this line to the already working plugin
Effect.server.Run("assets/bundled/prefabs/fx/invite_notice.prefab", player.GetNetworkPosition());​

I replaced "Effect.server.Run" with "EffectNetwork.Send" and got this error

Error while compiling: RustPM.cs(162,32): error CS1503: Argument `#1' cannot convert `string' expression to type `Effect'
EffectNetwork.Send does not accept a string parameter.  You will need to instantiate a new Effect object.

Made with love powered with oxide

        private static void RunEffect(Vector3 position, string prefab, BasePlayer player = null) // Made by Orange
        {
            var effect = new Effect();
            effect.Init(Effect.Type.Generic, position, Vector3.zero);
            effect.pooledString = prefab;

            if (player != null)
            {
                EffectNetwork.Send(effect, player.net.connection);
            }
            else
            {
                EffectNetwork.Send(effect);
            }
        }
Thank you, Orange, but I switched back to PrivateMessages plugin from uMod since this one works with BetterChatIgnore and BetterChatMute.
I've been looking at the code for at least 15mins and I can't understand where to add the sound effect code, it looks nothing like the other PM plugin, but I don't understand any programming anyway.
I was actually surprised when I added the Effect.server.Run line to the other plugin and it kinda did what I wanted without any errors.
runescape
Thank you, Orange, but I switched back to PrivateMessages plugin from uMod since this one works with BetterChatIgnore and BetterChatMute.
I've been looking at the code for at least 15mins and I can't understand where to add the sound effect code, it looks nothing like the other PM plugin, but I don't understand any programming anyway.
I was actually surprised when I added the Effect.server.Run line to the other plugin and it kinda did what I wanted without any errors.
You'd pass the string prefab as an argument to the method if using the above code.
I have no idea how to implement that on PrivateMessages, I have zero experience in coding, besides some copy pasting and praying that it works.
runescape
I have no idea how to implement that on PrivateMessages, I have zero experience in coding, besides some copy pasting and praying that it works.

If you will add me in discord i can add that small change for you

5ba216a6d7f65.png Orange

Made with love powered with oxide

        private static void RunEffect(Vector3 position, string prefab, BasePlayer player = null) // Made by Orange
        {
            var effect = new Effect();
            effect.Init(Effect.Type.Generic, position, Vector3.zero);
            effect.pooledString = prefab;

            if (player != null)
            {
                EffectNetwork.Send(effect, player.net.connection);
            }
            else
            {
                EffectNetwork.Send(effect);
            }
        }

is this still working trying to send "assets/prefabs/weapons/rocketlauncher/effects/reload_insert_rocket.prefab" but no sound. trying to get the rocket reload sound to play but unsure prefab..