1. Hey ! I would like to know if it's possible to know when the player open her inventory. Thanks you.

    Edit: Sorry, i've found a solution with the forum search. Thanks.
     
    Last edited by a moderator: Aug 13, 2015
  2. Code:
    input.IsDown(BUTTON.INVENTORY);
    
    or
    Code:
    input.WasJustPressed(BUTTON.INVENTORY)
    
    Wrong section.
     
  3. Sorry for Wrong section. I don't see where i can move my thread. And Thanks for your reply.
    [DOUBLEPOST=1439481697,1439453521][/DOUBLEPOST]With this method, i don't know when the player close her inventory, if he use ESCAPE or other.. It's not the good solution.
     
  4. I think there is no other solution.
     
  5. yup, I used that possibillity for my Crosshair plugin, and I did not find another way to do this.
     
  6. You'll have to capture opening the inventory with the OnPlayerInput hook listening for the key, then you can use OnTick to check that player if he is still looting (example below). The main issue that it can't be handled with a hook is because the server only manages the contents of the inventory, opening and closing it is only done on the client.

    Code:
    private void OnTick()
    {
        foreach (var player in BasePlayer.activePlayerList) // Just as example of course, should be replaced by a specific player list as you don't want to loop every player here.
        {
            if (!player.inventory.loot.IsLooting())
            {
                // Inventory closed
            }
        }
    }
     
  7. Didnt think about that. Thanks. Gonna add that to my plugin.
     
  8. IsLooting only works with other entities, like corpses sleepers etc. Not with the own inventory.
     
  9. Using OnTick should be really used to the minimum ^^
     
  10. Any idea on how to detect if a player has his inventory opened?