Page 1 of 1

[Mod] Inventory Check [1.0] [inventorycheck]

PostPosted: Sun Feb 15, 2015 18:19
by thefamilygrog66
This is a simple mod that allows admins/moderators to view the inventories for players by using the /inv <player> command. I'd previously written an even simpler version that uses formspecs, but there is a bug in the Minetest engine that doesn't allow it to work for other players' inventories. So, in the meantime, this is a text version.

Download: https://github.com/thefamilygrog66/inventorycheck/archive/master.zip

Browse code: https://github.com/thefamilygrog66/inventorycheck

Re: [Mod] Inventory Check [1.0] [inventorycheck]

PostPosted: Sun Feb 15, 2015 18:55
by Krock
You could do a workaround with a temporary detached inventory, fill it stack by stack.

Re: [Mod] Inventory Check [1.0] [inventorycheck]

PostPosted: Sun Feb 15, 2015 22:04
by Napiophelios
I dont know if it works, but Zeg9 has something similar on github, maybe it can help.
it uses minetest.register_privilege("invsee","See other's inventories")

https://github.com/Zeg9/minetest-invsee

Re: [Mod] Inventory Check [1.0] [inventorycheck]

PostPosted: Mon Feb 16, 2015 01:20
by thefamilygrog66
Krock wrote:You could do a workaround with a temporary detached inventory, fill it stack by stack.


Napiophelios wrote:I dont know if it works, but Zeg9 has something similar on github, maybe it can help.
it uses minetest.register_privilege("invsee","See other's inventories")


Thanks for the suggestions -- I really want to keep it as simple as possible, and haven't been able to figure out how to use detached inventories. Here's my original code, to see what I mean:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_chatcommand("inv", {
   params = "<name>",
   description = "Shows inventory of <name>",
   func = function(name, param)
      local str = "size[8,6]"..
         "label[3.5,4;"..param.."]"..
         "list[player:"..param..";main;0,0;8,4;]"..
         "button_exit[3,5;2,1;button;Done]"
      minetest.show_formspec(name, "inventory", str)         
   end,
})