Code: Select all
-- Called when a player wants to take items out of the inventory
allow_take = function(inv, listname, index, stack, player) end,
I guess that those callbacks are only for the same inventory lists.
:-)
Code: Select all
-- Called when a player wants to take items out of the inventory
allow_take = function(inv, listname, index, stack, player) end,
Yes, cos it is difficult to explain it, even in my native language. I have 3 inventories: "main" (player inv), "cloths" (player inv) and "closet" (node inv) in the same form.Nathan.S wrote: ↑Sun Nov 22, 2020 19:17I'm slightly confused as to what exactly you are trying to do. Allow_take doesn't need the name of the inventory that you are moving the item too, it only needs the inventory the item is being taken from. If you are trying to keep a player from putting something into their inventory you could do that with an allow_put, and put that code in the inventory you are trying to keep the player from putting the item in.
Not sure if that helps at all. I think we have a little language barrier. :)
Code: Select all
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player),
-- Called when a player wants to move items inside the inventory.
-- Return value: number of items allowed to move.
No, this is only for lists from the same inventory type. Inventory types are 3: player, node and detached.vibes81 wrote: ↑Mon Nov 23, 2020 18:26Hi im new to minetest modding but wouldnot be what you want?Code: Select all
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player), -- Called when a player wants to move items inside the inventory. -- Return value: number of items allowed to move.
From what I understand this is called whenever you want to move something from one list to another
Users browsing this forum: No registered users and 6 guests