1. Hello.
    Code:
    [HookMethod("OnPlayerLand")]
        object OnPlayerLand(BasePlayer player, float num)
        {
            return false;
        }
    =>
    /*
    * -/-/- kicked: RPC Error in OnPlayerLanded
    * ArgumentOutOfRangeException: Argument is out of range.
    * Parameter name: index
    * return false;
    */
     
  2. Wulf

    Wulf Community Admin

    Firstly, remove the [HookMethod] attribute you are using, that is not necessary. As far as the hooks go, both looks like fine and are correctly positioned and calling valid arguments, so it's unlikely to be the hook itself causing it.

    Keep in mind that OnPlayerLand and OnPlayerLanded are different hooks, one is pre and one is post.
     
  3. He used only dll(Extension), for production)
     
  4. I correctly use Oxide Hooks. When I use "return null" there is no error. When I use "return false" error there is.
    http://i.imgur.com/RrRmYQb.png
    9tsh9OK.png

    I found what the problem, this error appears when used Unsubscribe(nameof(OnPlayerLand)); & return false;
     
    Last edited by a moderator: Apr 6, 2017
  5. IXlSUtI.png
    The error above occurs because of this line
    5XVGZBb.png
    When "OnPlayerLand" is called, I use "Unsubscribe (nameof (OnPlayerLand));" Because of what the "pluginList" list changes and when the code is executed below the error occurs.
    RAwLde5.png
     
  6. And the result is still like Wulf said: the hook is working correct and you did use it (in) wrong (combination)...nothing else ;)
     
  7. Hook can and works correctly, but "Unsubscribe" does not.
     
  8. Wulf

    Wulf Community Admin

    I don't think Unsubscribe was ever intended to be called inside the hook, so it was likely never tested there. It does work fine outside of hooks as I use that in numerous plugins.
     
  9. Okay, are you going to fix the bug? I can give you a ready code to correct the error.
     
  10. Wulf

    Wulf Community Admin

    Feel free to open a PR with the suggested changes.
     
  11. Try this
    Code:
    Interface.Oxide.NextTick(()=>Unsubscribe(nameof(OnPlayerLand)));
     
  12. Okay.
    Sorry of course, but the method is shit. Using timers to fix bugs, the path to the abyss.
     
  13. Why timers?
    NextTick is event!
    [​IMG]