I am attempting to use RustIO FriendlyFire's EnableBypass and DisableBypass methods. Below is the code I am using:
The definition for RustIO's EnableBypass and DisableBypass are below: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 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:[LibraryFunction("EnableBypass")] public bool EnableBypass(object playerId) { ... } [LibraryFunction("DisableBypass")] public bool DisableBypass(object playerId) { ... }
The calls should be working, but are not. I would appreciate any help in understanding what is going on here.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)
Obviously, friendly fire is not being bypassed.
Solved Calling another plugin's hooks fail
Discussion in 'Rust Development' started by theconezone, Nov 16, 2015.
-
Wulf Community Admin
I believe the methods/hooks you are calling would need to be private, not public.
-
Thanks.