1. Soo I am still working on my system of "guest" users and I would like to prevent them to access any other inventories than... lets say campfires.

    What would be a good point of entry?
     
  2. Code:
    void OnLootEntity(BaseEntity entitySource, BaseEntity targetEntity)
    {
         BasePlayer source = entitySource as BasePlayer;
         if(source == null) return;
         //check here is source is guest or something
        
         NextTick(() =>
         {
               source.EndLooting();
         });
    }
    
    You could use that. Not sure if it works didn't test it.
     
    Last edited by a moderator: May 2, 2016
  3. It appears to be working, but why the NextTick Call?

    Nevermind I got it.

    Thanks, it appears to be working.
     
    Last edited by a moderator: May 3, 2016
  4. Wulf

    Wulf Community Admin

    It just delays it a bit, otherwise if doesn't always work I believe.
     
  5. Lol good to know, was always confused on why it never worked!
     
  6. Probably because when OnLootEntity is called looting hasn't really started yet, so BasePlayers.EndLooting doesn't work.