1. So, I have this program that gets the playerCount and displays it as a notification, but for it to update, it has to be reloaded everytime, is there anyway that I can make it refresh itself?
    This is the code I use to get the playerCount and display it:
    Code:
    int playerCount = Singleton<GameManager>.Instance.GetPlayerCount();void OnPlayerConnected(PlayerSession session)
    {
     string showPlayers = playerCount.ToString();
    AlertManager.Instance.GenericTextNotificationServer("Players: " + showPlayers, session.Player);         
    }
     
  2. Wulf

    Wulf Community Admin

    Use the timer library with Oxide to refresh the count. You don't need to reload the plugin.
     
  3. I think you just should insert playerCount into OnPlayerConnected:

    Code:
    void OnPlayerConnected(PlayerSession session)
    {
        int playerCount = Singleton<GameManager>.Instance.GetPlayerCount();
        string showPlayers = playerCount.ToString();
        AlertManager.Instance.GenericTextNotificationServer("Players: " + showPlayers, session.Player);        
    }
    If you want to show notification for all players when anybody join server just delete "session.Player" argument.

    Code:
    AlertManager.Instance.GenericTextNotificationServer("Players: " + showPlayers);