1. Heyo!
    I've seen that there was a new hook added - CanCraft(PlayerBlueprints bps, ItemDefinition itemDef, int skinId)
    But it doesn't seems to be called at all.
    Here is my code:

    Code:
    void CanCraft(PlayerBlueprints bps, ItemDefinition itemDef, int skinId)
            {
                Puts("CanCraft new called!");
            }
    Aaaand.... nothing. It's not being called at all.
    No matter what I'm doing - I can even start crafting and it's not working.

    Can it be cos we already have the hook with the same name? (Also - why creating 2 hooks with the same name?)
    New one:
    Code:
      public bool CanCraft(int itemid, int skinItemId)
      {
        ItemDefinition itemDefinition = ItemManager.FindItemDefinition(itemid);
        if ((UnityEngine.Object) itemDefinition == (UnityEngine.Object) null)
        {
          object obj = Interface.CallHook("CanCraft", (object) this, (object) itemDefinition, (object) skinItemId);
          if (obj is bool)
            return (bool) obj;
          return false;
        }
        return (skinItemId == 0 || this.steamInventory.HasItem(skinItemId)) && (this.IsParentUnlocked(itemDefinition) && (double) this.baseEntity.currentCraftLevel >= (double) itemDefinition.Blueprint.workbenchLevelRequired) && this.HasUnlocked(itemDefinition);
      }
    The old one:

    Code:
      public bool CanCraft(ItemBlueprint bp, int amount = 1)
      {
        if (amount < 1 || amount > 9000)
          return false;
        object obj = Interface.CallHook("CanCraft", (object) this, (object) bp, (object) amount);
        if (obj is bool)
          return (bool) obj;
        foreach (ItemAmount ingredient in bp.ingredients)
        {
          if (!this.DoesHaveUsableItem(ingredient.itemid, (int) ingredient.amount * amount))
            return false;
        }
        return true;
      }
    The last one seems working, but only if the player has required workbench aronud.
    So..... any ideas why the new one doesn't work?
     
  2. Wulf

    Wulf Community Admin

    Hooks can have the same name now with different arguments, that's what the hook 'overloading' is that @Mughisi added.

    I suspect one issuing ignored though, so looking into it. Could you test with each one individually please?
     
  3. I did. The new one doesn't seems to be working at all. Both at the same time - would do now.
    @Wulf, have you read the latest devblog? Maybe you can help me out.
    They said that there is a new RPC - craftLevel
    They are talking about that 'CraftLevel", but I see nothing related in the code. Attempt to use it shows this:
    StringPool.GetNumber - no number for string craftLevel
    Here is the code I'm using:
    Code:
            [ChatCommand("test")]
            private void cmdTest(BasePlayer player, string command, string[] args)
            {
                if(args.Length < 1)
                {
                    player.ChatMessage("Wrong args"); return;
                }
                int level;
                if(!int.TryParse(args[0], out level))
                {
                    player.ChatMessage("Arg must be int!");
                    return;
                }
                player.ClientRPCPlayer(null, player, "CraftLevel", level);
            }
    Maybe I'm doing something wrong? Do you have a moment to take a look?
     
  4. Wulf

    Wulf Community Admin

    I'll take a look at the hook.

    For the craftLevel stuff, I'd suggest taking a look at NoWorkbench as I believe it makes use of it. Other than that i am not familiar with it.
     
  5. Wulf

    Wulf Community Admin

    Should be good in the latest snapshot (on AppVeyor), appeared to have the hook index off a bit.
     
  6. Gonna try and let you know.
    There is something really broken in the lates build there - upload_2017-10-9_13-25-39.png
    [DOUBLEPOST=1507544810][/DOUBLEPOST]Unload doesn't seems to be working as well
    [DOUBLEPOST=1507546262][/DOUBLEPOST]Ok, now both hooks seems to be working, but I was expecting the new one being called then the player attempt to craft something without worbench, so we can intercept it and allow players to craft it without workbench.

    Looks like it's being handled by the client side, cos the hook doesn't even being called without workbench near it....
     
  7. Wulf

    Wulf Community Admin

    Commands not broken, see Add/remove some core Oxide command aliases · OxideMod/Oxide@cf569a8 · GitHub.
     
  8. oh my... what was the main purpose of this? global.reload was interfearing with some games? Dang. That s*cks...