1. Hello, Wulf.
    As I see, I can't call a hook with object as parameter after last Oxide update.
    For example, CheckPoints from ServerRewards is not called.
     
  2. Wulf

    Wulf Community Admin

    Do you have any specific examples?
     
  3. a similar problem
     
  4. Code:
    private void ShowPoints(ulong userID) => System.Console.WriteLine(ServerRewards.Call("CheckPoints", userID));
    Always returns null.
     
    Last edited by a moderator: Feb 15, 2018
  5. Wulf

    Wulf Community Admin

    Have to tried casting to the actual type that the plugin returns? An Object isn’t the actual type in most cases.
     
  6. Yes, of course. I do that in most cases. All worked fine before last Oxide update. I made a mistake, sorry, it always returns null.
    Code:
    System.Console.WriteLine(ServerRewards.Call("CheckPoints", userID) == null)
    Always true.
     
  7. im assuming something changed in the ..
    Code:
                   var player = RustCore.FindPlayerByIdString(id);
                   if (player == null) return 0;
                   return (int)instance.ServerRewards?.Call("CheckPoints",  Convert.ToInt64(id));
    maybe

    var player = RustCore.FindPlayerByIdString(id);
    [DOUBLEPOST=1518753881][/DOUBLEPOST]IT WAS removed the Convert.ToInt64 all is fine now
    [DOUBLEPOST=1518753940][/DOUBLEPOST]so now works like this.


    Code:
                   var player = RustCore.FindPlayerByIdString(id);
                   if (player == null) return 0;
                   return (int)instance.ServerRewards?.Call("CheckPoints",  (id));
               }
    
     
  8. Wulf

    Wulf Community Admin

    That is not correct. The issue is with Oxide. Changing the hook argument to something that isn't there (invalid signature) will not work and will cause issues. If the hook expects a string, you should be sending a string. If the hook expects a ulong, you should be sending a ulong.
     
  9. But CheckPoints from ServerRewards receiving userID as object.
     
  10. Wulf

    Wulf Community Admin

    Actually it's a ulong, not an object or string.
     
  11. same here ServerRewards example:
    private object AddPoints(object userID, int amount)

    ServerRewards?.Call("AddPoints", (object)(player.UserIDString), 10);
    ServerRewards?.Call("AddPoints", player.UserIDString, 10);
    ServerRewards?.Call("AddPoints", player.userID, 10);

    not working
     
  12. Code:
    if (!init) return null;
                BaseEntity baseEntity = entity as BaseEntity;
                if (baseEntity == null || !IsBlockEntity(baseEntity)) return null;
                if (baseEntity.net?.ID == null) return null;
                if (adminIgnore && target.IsAdmin) return null;
    This also does not work