added vanish mod by Sullome

master
vegasd 2014-02-01 17:40:53 +04:00
parent c931860aa5
commit 0c642d5130
1 changed files with 23 additions and 0 deletions

23
vanish/init.lua Normal file
View File

@ -0,0 +1,23 @@
vanished_players = {}
minetest.register_privilege("vanish", "Allow to use /vanish command")
minetest.register_chatcommand("vanish", {
params = "",
description = "Make user invisible",
privs = {vanish = true},
func = function(name, param)
local prop
vanished_players[name] = not vanished_players[name]
if vanished_players[name] then
prop = {visual_size = {x=0, y=0}, collisionbox = {0,0,0,0,0,0}}
else
-- default player size
prop = {visual_size = {x=1, y=1},
collisionbox = {-0.35, -1, -0.35, 0.35, 1, 0.35}}
end
minetest.get_player_by_name(name):set_properties(prop)
end
})