Hey does anyone know how I could make it so that items of clothing that are not allowed to be warn together can be? Example: When you try and wear a Burlap Headwrap with a Bandana Mask, it puts one or the other in your inventory. Is there a way around this?
Allowing restricted clothing items to be worn together?
Discussion in 'Rust Development' started by Spectrum Modz, Mar 21, 2017.
-
Calytic Community Admin Community Mod
Unlikely. It should technically be feasible but I would venture a guess that the rust client does not synchronize item occupation slots - as most item options, with a few exceptions, are not currently synchronized. In other words, you could change the item occupation slots on your server, however the players who join your server would not receive the modified item definitions and the mismatch would likely cause unexpected behavior or errors.
In short, FacePunch could add this (relatively easily) and it's really up to them. -
I have been playing around with this back in 2015, it was possible without any hassles.
Here's a ways:
1. Using hook CanWearItem
2. Replacing the delegate ItemContainer.canAcceptItem, like this:
Code:player.inventory.containerWear.canAcceptItem = _ => true;
p.s Here's i've got:
Imgur: The most awesome images on the Internet -
Something like:
Code:using System.Collections.Generic;namespace Oxide.Plugins { [Info("Test Plugin", "DylanSMR", "1.0.0", ResourceId = 0)] [Description("Test Plugin")] class TestPlugin : RustPlugin { Dictionary<string, string> blacklisted = new Dictionary<string, string>() { {"item name","item name"}, }; bool CanWearItem(PlayerInventory inventory, Item item) { Item[] array = inventory.containerWear.itemList.ToArray(); for(var i = 0; i < array.Length; i++) { var itemMain = array[i]; foreach(var e in blacklisted) { if(e.Key == itemMain.name && e.Value == item.name) { return false; } if(e.Value == itemMain.name && e.Key == item.name) { return false; } } } return null; } } }
Last edited by a moderator: Mar 25, 2017 -
Calytic Community Admin Community Mod
That's a smart workaround, though it doesn't actually change the item occupation slots.
-