2019-05-11 21:33:06 +02:00
|
|
|
minetest.register_chatcommand("setinfo", {
|
|
|
|
params = "<info>",
|
|
|
|
description = "Sets your info",
|
|
|
|
func = function(name, param)
|
|
|
|
local player = minetest.get_player_by_name(name)
|
|
|
|
player:set_attribute("info", param)
|
|
|
|
return true, "Set your info"
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_chatcommand("seeinfo", {
|
|
|
|
params = "<info>",
|
|
|
|
description = "Sets your info",
|
|
|
|
func = function(name, param)
|
2019-05-11 22:21:31 +02:00
|
|
|
local player = minetest.get_player_by_name(name)
|
|
|
|
if not player then
|
|
|
|
return false, "Player not found"
|
|
|
|
end
|
2019-05-11 21:33:06 +02:00
|
|
|
local player2getinfo = minetest.get_player_by_name(param)
|
|
|
|
minetest.chat_send_player(player:get_player_name(), player2getinfo:get_attribute("info"))
|
|
|
|
end,
|
|
|
|
})
|