How to correctly give Door Key to player and set him as key owner in my InstantCraft plugin?
Now, I'm just skip Door Key item in OnItemCraft function.
[DOUBLEPOST=1455300376,1455205353][/DOUBLEPOST]Any ideas?Code:using Oxide.Core; using Oxide.Plugins;namespace Oxide.Plugins { [Info("InstantFullCrafting", "WhoIsIt", "1.0")] class InstantFullCrafting : RustPlugin { private object OnItemCraft(ItemCraftTask task) { if (task.blueprint.targetItem.displayName.english.Contains("Door Key")) return null; var item = task.blueprint.targetItem.itemid; var amount = task.blueprint.amountToCreate * task.amount; task.owner.inventory.GiveItem(ItemManager.CreateByItemID(item, amount, false, task.skinID)); task.cancelled = true; task.owner.Command("note.inv", item, amount); // just notify return null; } }}
Crafting / giving a door key?
Discussion in 'Rust Development' started by azalea`, Feb 12, 2016.
