1. 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
     
  2. I believe you can set it on just an item. Use GetSlot and apply the flag to the item.
     
  3. can u write an example how exaclty i can do it with GetSlot?

    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?
     
  4. If someone know plugins where dev. uses slot blocks, share it there please.
     
  5. Code:
                player.inventory.containerBelt.GetSlot(0).SetFlag(
                    global::Item.Flag.IsLocked, true);
    
    Item appear locked but you can still use it, it's weird...

    It don't seem to be possible to lock a single slot
     
    Last edited by a moderator: Oct 19, 2017
  6. nope, u cant.
     
  7. I did it in an old plugin, I'll try to find the code.
     
  8. GetSlot() return the item class instead of the slot, you can lock the item but as I said it appear locked but you can use it...
     


  9. timecode: 2m 32s - 2m 40s

    Showing that he cant do anything with equipped one
     
  10. I had try with belt not wear
     
  11. Any ideas about item block? With code example please :s
     
  12. 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?
     
  13. up

    Still searching for method which one will prevent players from removing item from container ..