Method for sending message on player connect?
So I wanna send a message to a player when they login. So I use the OnPlayerConnected(Network.Message packet) hook but doing player.reply(""); doesn't work. So I added IPlayer player to it since I thought it would work. Because that's what I used for the commands hook but that didn't work either. So is there another way to do this?
In response to warmerspy ():
So I wanna send a message to a player when they login. So I use the OnPlayerConnected(Network.Messag...
Each hook have args specified in docs. When you write code you can use those args or don't use them or use only those u need, but can't add extra args since there is no data to pass to the method. 
Player can be taken from the network.message like in example below
        void OnPlayerConnected(Network.Message packet)
        {
            var player = packet.Player();
            player.ChatMessage("message");
            //or
            SendReply(player, "message");
        }​
For IPlayer, it would be player.Reply, not player.reply. The casing matters for all methods. I’d suggest looking at either your log files or server console for possible errors as well when developing plugins outside of an IDE.
In response to 2CHEVSKII ():
Each hook have args specified in docs. When you write code you can use those args or don't use them...


I tried that with the
void OnPlayerConnected(Network.Message packet)
        {
            var player = packet.Player();
            player.ChatMessage("Message");

        }​

and the server told me:

Error while compiling: Class1.cs(13,33): error CS1061: Type `Network.Message' does not contain a definition for `Player' and no extension method `Player' of type `Network.Message' could be found. Are you missing `UnityEngine' using directive?

So I added a using directive for UnityEngine and now it tells me:

Failed to call hook 'OnPlayerConnected' on plugin 'Class1 v0.1.0' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.Class1.OnPlayerConnected (Network.Message packet) [0x00007] in <d4e40234b9ed4309851aa3b90d86faea>:0
at Oxide.Plugins.Class1.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00032] in <d4e40234b9ed4309851aa3b90d86faea>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <4452f821def6406d834e4149849fe7ea>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0
 
So am I missing something else here?
In response to warmerspy ():


I tried that with thevoid OnPlayerConnected(Network.Message packet) {...
No, it's my fault, I've forgot that this hook is called before player is ready to receive chat messages, so it won't work.
Use OnPlayerInit instead.
        void OnPlayerInit(BasePlayer player) => player.ChatMessage("Welcomemessage");
i just use rust admins for sending messges to people logining in or out one less plugin to deal with