commit 5fe7d6e9b950b3cefb730a629545c4f6ee2c6398 Author: ezhh Date: Sat Jan 14 00:17:22 2017 +0000 Add name hide and show commands diff --git a/README.md b/README.md new file mode 100644 index 0000000..b4aeb33 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +name_hider +========= + +Minetest mod by Shara RedCat which adds two commands: + +1. '/hidenames' hides the nametags of all currently connected players. +2. '/shownames' shows the name tags of all currently connected players. + + + +Licenses and Attribution +----------------------- + +Code for this mod is released under MIT (https://opensource.org/licenses/MIT). + diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..e69de29 diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..03824a9 --- /dev/null +++ b/init.lua @@ -0,0 +1,21 @@ + +minetest.register_chatcommand("hidenames", { + description = "Make all nametags invisible", + privs = {server = true}, + func = function(name, param) + for _, player in pairs(minetest.get_connected_players()) do + player:set_nametag_attributes({color = {a = 0, r = 255, g = 255, b = 255}}) + end + end +}) + +minetest.register_chatcommand("shownames", { + description = "Make all nametags visible", + privs = {server = true}, + func = function(name, param) + for _, player in pairs(minetest.get_connected_players()) do + player:set_nametag_attributes({color = {a = 255, r = 255, g = 255, b = 255}}) + end + end +}) + diff --git a/license.txt b/license.txt new file mode 100644 index 0000000..beec255 --- /dev/null +++ b/license.txt @@ -0,0 +1,27 @@ + +License: MIT (https://opensource.org/licenses/MIT) +By Shara RedCat + +--- + +The MIT License (MIT) + +Copyright (c) 2016 Shara RedCat + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..d6a9841 --- /dev/null +++ b/mod.conf @@ -0,0 +1 @@ +name = name_hider \ No newline at end of file