1. Hi, I am trying to make something like this:
    Code:
    foreach (BasePlayer PVPCheck in BasePlayer.activePlayerList)
      {
      if (Reynostrum is disconnected)
      {
      // do something
      }
      }
    
    Thanks.
     
  2. Wulf

    Wulf Community Admin

    The activePlayerList is only for players that are online (active). You can check if a player is connecting by using "player.IsConnected" I believe. Visual Studio will show you this if you setup a proper project with the references to Assembly-CSharp.dll and such.
     
  3. Something like this?

    Code:
    if(player = null && !player.IsConnected())
     
  4. Wulf

    Wulf Community Admin

    ==, not = otherwise yes.
     
  5. void OnPlayerDisconnected(BasePlayer player, string reason)
    {
    //Do Magic :D
    }

    Rust
     
  6. Wulf

    Wulf Community Admin

    He wants to check if a player is disconnected, not do something when they disconnect from what I can tell.
     
  7. Code:
    if (!AtacantePVP.IsConnected())
    It work :)

    Thanks
     
  8. Ahhhhhhhh sooo.... I have an idea!

    Maybe check if player is online(Checking if player is not in that list will result in player disconnected or never connected):

    Code:
            List<BasePlayer> onlineplayers = BasePlayer.activePlayerList as List<BasePlayer>;
    
    You can look for disconnected players too somehow :D
     
  9. Wulf

    Wulf Community Admin

    The IsConnected() check works fine, why do more than needed?