Getting chat message from ConsoleSystem.Arg?Solved
hello im new in plugins, and i need help, how to fix this command, game makes so much updates because last time this plugin was working last time.

using Rust;

namespace Oxide.Plugins
{
[Info("Players", "dunno", "0.1.0")]
public class Players : RustPlugin
{
    void OnPlayerChat(ConsoleSystem.Arg arg)
        {
            var message = arg.GetString(1);
            if (message.Contains("!players"))
            {
                var playerCount = BasePlayer.activePlayerList.Count;
                if (playerCount > 1)
					PrintToChat($"<color=#FF7400>[Rustical] </color><color=#B1B1B1>PLAYERS ONLINE:</color> <color=red>{playerCount}</color>");
                else
					PrintToChat("<color=#FF7400>[Rustical] </color><color=#B1B1B1>PLAYERS ONLINE:</color> <color=red>{playerCount}</color>");				
            }
        }
}
}​
var message = arg.GetString(0);
Still not working..
You'll need to provide a bit more details about what exactly isn't working.
When I type !players to chat, so it must write this: PLAYERS ONLINE: x and this output when I write it can see everyone on server.
Okay, but what part about it isn't working?
It dosen't write anything into chat when I write !players
Ah right..

void OnPlayerChat(BasePlayer player, string message, string[] args)​


I've got this error
You'll have to adjust your plugin accordingly.

Removal of:
var message = arg.GetString(1);​

I removed it, now plugin is now compiled correctly, but still nothing displays in chat.

using Rust;

namespace Oxide.Plugins
{
[Info("Players", "qw", "0.1.0")]
public class Players : RustPlugin
{
    void OnPlayerChat(BasePlayer player, string message, string[] args)
        {
            if (message.Contains("!players"))
            {
                var playerCount = BasePlayer.activePlayerList.Count;
                if (playerCount > 1)
                   // rust.BroadcastChat($"On this server is currently {playerCount} players online.");
					PrintToChat($"<color=#FF7400>[Rustical] </color><color=#B1B1B1>PLAYERS ONLINE:</color> <color=red>{playerCount}</color>");
                else
                  //  rust.BroadcastChat("On this server is currently 1 player online.");  
					PrintToChat("<color=#FF7400>[Rustical] </color><color=#B1B1B1>PLAYERS ONLINE:</color> <color=red>{playerCount}</color>");				
            }
        }
}
}
Sorry, this is the correct signature:
void OnPlayerChat(BasePlayer player, string message)​
It's working now. Thanks for help, I wouldn't solve anything without you. :D And thanks for fast replies!
Locked automatically