1. Is it possible to set bears to NOT eat player corpses?

    Problem is bears are eating a lot of my players bodies and all the items they had on them.
     
  2. Code:
        public bool CanEat(BaseCombatEntity entity)
        {
            return (!this.hunter ? false : entity is BaseCorpse);
        }
    Would probably do. Oxide would need a hook on it unless there is some other way to override this.
     
  3. where would i add this to if i may ask
     
  4. Create Cs file copy text and add to plugins
     
  5. Error: Parse error on line 1:
    public bool CanEat(B
    ^
    Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'
     
  6. If you download another plugin and take a look at its structure, I believe youll need:
    - a namespace of Oxide.Plugins
    - a class that inherits from RustPlugin or CovalencePlugin

    Something like this:
    Code:
    namespace Oxide.Plugins
    {
        [Info("FriendlyBear", "", "0.0.1")]
        [Description("Stops Bears Eating Corpses")]
        class FriendlyBear : RustPlugin
        {
            // Stuff
        }
    }
    
     
    Last edited by a moderator: May 9, 2017
  7. All those include are useless as they are not used at all
     
  8. @sami37 I just copied the includes from another plugin, please list which ones are needed
     
  9. None of them ^^
     
  10. Woah thats cool, so we have access to Rust Oxide hooks just by inheriting from RustPlugin class? or being part of the namespace?
    (I edited the post to remove the using statements)
     
  11. Wulf

    Wulf Community Admin

    No, a "hook" is something that Oxide calls once it is triggered in the game it is hooking. Using statements are used to essentially tell parts of the code where to look for various things, some of these are looked for by default based on the namespace and default references. Now, there is no hook called "CanEat", so that plugin would never work unless something calls that hook and makes use of it.
     
  12. Code:
    object CanNpcEat(BaseNPC npc, BaseCombatEntity target)
    {
        return false; //Returns false meaning it cannot eat whatever.
    }
    The code I posted before was straight from the game code. This is from oxide. As togoshige said above.
     
  13. Can someone please elaborate on how to get this to work. The above code gives a compiling error.