[Mod] Inventory Check [1.0] [inventorycheck]

Post Reply
User avatar
thefamilygrog66
Member
Posts: 170
Joined: Mon Jul 09, 2012 19:08
Location: Ontario, Canada

[Mod] Inventory Check [1.0] [inventorycheck]

by thefamilygrog66 » Post

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/inve ... master.zip

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

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

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

by Krock » Post

You could do a workaround with a temporary detached inventory, fill it stack by stack.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Napiophelios
Member
Posts: 1035
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

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

by Napiophelios » Post

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

User avatar
thefamilygrog66
Member
Posts: 170
Joined: Mon Jul 09, 2012 19:08
Location: Ontario, Canada

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

by thefamilygrog66 » Post

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:

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,
})

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests