I searched in forum but nothing help me solving this.
Well, i dont have much to say. This is my code:
Code:Failed to call hook 'OnItemCraft' on plugin 'TestSkin v1.0.0' (NullReferenceException: Object reference not set to an instance of an object)Thank you!!!Code:using System.Linq;namespace Oxide.Plugins { [Info("TestSkin", "testing", 1.0)] [Description("teeeeeeest")] class TestSkin : RustPlugin { private void Loaded() { LoadDefaultConfig(); permission.RegisterPermission("test.testing", this); } private void OnItemCraft(ItemCraftTask task, BasePlayer crafter, BasePlayer player) { if (!HasPermission(player, "test.testing")) //I THINK THIS IS THE PROBLEM { SendReply(player, "Normal Cloth"); return; } var skins = ItemSkinDirectory.ForItem(task.blueprint.targetItem); if (skins.Count() < 2) return; task.skinID = skins.GetRandom().id; } private void OnItemCraftFinished(ItemCraftTask task, Item item) { if (task.amount == 0) return; var skins = ItemSkinDirectory.ForItem(task.blueprint.targetItem); if (skins.Count() < 2) return; task.skinID = skins.GetRandom().id; } bool HasPermission(BasePlayer player, string perm) => permission.UserHasPermission(player.UserIDString, perm); } }
NRE with my plugin, unsure how to debug
Discussion in 'Rust Development' started by Reynostrum, Nov 23, 2015.