hello this works fine but the last update destroys it.
here is my code.
Code:void OnPlayerChat(ConsoleSystem.Arg arg) { var message = arg.GetString(0); if (message.Contains("!players")) { var playerCount = BasePlayer.activePlayerList.Count; if (playerCount > 1) rust.BroadcastChat($"There are currently {playerCount} players online."); else rust.BroadcastChat("There is currently 1 player online."); } }
ERROR says
Code:Failed to call hook 'OnPlayerChat' on plugin 'PlayerCount v1.0.3' (NullReferenceException: Object reference not set to an instance of an object)...........
hope someone can help.
thanks
Solved Error when sending a message
Discussion in 'Rust Development' started by UNKNOWNNN, Nov 4, 2017.