Page 1 of 1

[Mod][Admin Tool] Inventory Management [0.2]

PostPosted: Sun Jan 01, 2017 21:55
by Sirvoid
A small tool for admins to manage there players inventory.

Features
- "/clearinv <Player>" To clear a player inventory
-"/copyinv <Player>" To copy a player inventory and paste it in your inventory. (Useful to see if someone is stealing)
-"/setinv <player> <slot> <item> <value> " to add items to a player in a specific slot.
(I am open to any suggestions)

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
-----v0.2------
-Added /setinv to add items to a player in a specific slot.



Github
Download

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
Licence: WTFPL

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE

Version 2, December 2004

Copyright (C) 2004 Sam Hocevar sam@hocevar.net

Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.

Re: [Mod][Admin Tool] Inventory Management [0.1]

PostPosted: Mon Jan 02, 2017 13:28
by DS-minetest
What about a "/setinv <player> <slot> <item>"?

Re: [Mod][Admin Tool] Inventory Management [0.1]

PostPosted: Mon Jan 02, 2017 22:07
by Sirvoid
DS-minetest wrote:What about a "/setinv <player> <slot> <item>"?


I added it ! thanks for the suggestion ^^

Re: [Mod][Admin Tool] Inventory Management [0.2]

PostPosted: Tue Jan 03, 2017 09:51
by Krock
Is there any way to see the contents of that player's inventory in a formspec?

Re: [Mod][Admin Tool] Inventory Management [0.2]

PostPosted: Tue Jan 03, 2017 18:14
by Sirvoid
Krock wrote:Is there any way to see the contents of that player's inventory in a formspec?


I was thinking about that when I made the copyinv but I didn't go further.
I will check what I can do for that.

Re: [Mod][Admin Tool] Inventory Management [0.2]

PostPosted: Wed Jan 04, 2017 19:31
by Foz
Krock wrote:Is there any way to see the contents of that player's inventory in a formspec?


I've been trying to figure this out too. There is an inventory location player:<name>, but it is only available to the player with that name. It seems to be exactly the same as current_player.

from #minetest-dev:
sfan5 wrote:i'm not even sure why we have the player:<name> thing since we also have current_player

Re: [Mod][Admin Tool] Inventory Management [0.2]

PostPosted: Thu Jan 05, 2017 01:47
by octacian
Nice Work! I was going to attempt some type of thing to see a player's inventory in a formspec myself for servertools, but haven't gotten around to it.

Also see this PR. Assuming it gets merged (who knows if it will, I just opened it a few minutes ago), you might want to add a check to only attempt to register /clearinv if the command doesn't already exist. IDK what happens when you try and register a duplicate, but...

Anyways, still, really great work.