1. I am attempting to use RustIO FriendlyFire's EnableBypass and DisableBypass methods. Below is the code I am using:
    Code:
    [PluginReference]
    Plugin FriendlyFire;[ChatCommand("test")]
    void Test(BasePlayer player, string command, string[] args) {
       //check if friendlyfire plugin was loaded
       if (FriendlyFire != null) {
         //call FriendlyFire.EnabeBypass(player.userID)
         object result = FriendlyFire.Call("EnableBypass", player.userID);     //Check if the hook was found and called successfully
         if (result is bool) {
           //output result
           SendReply(player, "FriendlyFire bypassed? {0}", (bool) result);
         } else {
           //FriendlyFire isn't loaded.
           SendReply(player, "FriendlyFire plugin is not loaded anymore.");
         }
       } else {
         //FriendlyFire isn't loaded.
         SendReply(player, "FriendlyFire plugin is not loaded.");
       }
    }
    The definition for RustIO's EnableBypass and DisableBypass are below:
    Code:
    [LibraryFunction("EnableBypass")]
    public bool EnableBypass(object playerId) { ... }
    [LibraryFunction("DisableBypass")]
    public bool DisableBypass(object playerId) { ... }
    The call to FriendlyFire.Call is returning null (as I tested with FriendlyFire.Call<bool> before), but I do not understand why. Both plugins are correctly loaded:
    Code:
    [Oxide] Listing 44 plugins:
    01 "Rust:IO for Oxide" (2.7.0) by playrust.io / dcode (5.59s)
    ...
    27 "FriendlyFire" (1.5.1) by playrust.io / dcode (0.33s)
    ...
    36 "Test" (0.1.0) by cone (0.00s)
    The calls should be working, but are not. I would appreciate any help in understanding what is going on here.

    Obviously, friendly fire is not being bypassed.
     
  2. Wulf

    Wulf Community Admin

    I believe the methods/hooks you are calling would need to be private, not public.
     
  3. Yup. That was the fix. I'll post a bug in the FriendlyFire thread.

    Thanks.