Sup guys i making a plug where i need to lock some slots in .containerWear. i make this:
player.inventory.containerWear.SetFlag(ItemContainer.Flag.IsLocked, true);
but it locks all slots in containerWear, so, how can i block just one? :s
Getting specific wear slot?
Discussion in 'Rust Development' started by Wikat, Oct 18, 2017.
-
I believe you can set it on just an item. Use GetSlot and apply the flag to the item.
-
player.inventory.containerWear.SetFlag(ItemContainer.Flag.IsLocked, true);
player.inventory.GiveItem(ItemManager.CreateByItemID(-1211618504, 1, 14178), player.inventory.containerWear);
Now Flag blocks all slots in Wear. How i can make block just for first, where item equiped? -
If someone know plugins where dev. uses slot blocks, share it there please.
-
Code:
player.inventory.containerBelt.GetSlot(0).SetFlag( global::Item.Flag.IsLocked, true);
It don't seem to be possible to lock a single slotLast edited by a moderator: Oct 19, 2017 -
-
I did it in an old plugin, I'll try to find the code.
-
-
timecode: 2m 32s - 2m 40s
Showing that he cant do anything with equipped one -
-
Any ideas about item block? With code example please :s
-
Okey, ive block the item for now, but i still can move it between slots. From different containers (ex: from wear to belt). Block gives me that i just cant remove item from inventory. What can i do now to bind it to specific slot or containerWear / prevent from moving it?
-
up
Still searching for method which one will prevent players from removing item from container ..