master
Yiu Man Ho 2020-09-12 15:46:28 +08:00
parent 459388fec6
commit bbb257de5a
No known key found for this signature in database
GPG Key ID: 7939838BC85BF618
2 changed files with 20 additions and 0 deletions

18
init.lua Normal file
View File

@ -0,0 +1,18 @@
minetest.register_chatcommand("user_info",{
param = "<user>",
description = "Get your client's info", -- Full description
func = function(name, param)
if not(param == "") then
local havepriv, m = minetest.check_player_privs(name, {server=true})
if not(havepriv) then
return false, "No privs to do this!"
end
name = param
end
local info = minetest.get_player_information(name)
if not info then return false, "player not found!" end
minetest.chat_send_player(name, "Info of "..name..":")
minetest.chat_send_player(name, "IP: "..info.address.." (IPv"..tostring(info.ip_version)..")")
minetest.chat_send_player(name, "Uptime: "..tostring(info.connection_uptime).."sec")
end,
})

2
mod.conf Normal file
View File

@ -0,0 +1,2 @@
name = my_info
description = Get Player's info