add chatcommands
This commit is contained in:
parent
448a8acf6a
commit
2d193d092a
17
chatcommands.lua
Normal file
17
chatcommands.lua
Normal file
@ -0,0 +1,17 @@
|
||||
minetest.register_chatcommand("chat_formspec", {
|
||||
params = "",
|
||||
description = "send a player who refuses communication attemps via public chat a formspec to chat",
|
||||
privs = {},
|
||||
func = function(name, _)
|
||||
chat_formspec.show_select_predefined(name)
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("chat_formspec_custom", {
|
||||
params = "",
|
||||
description = "send a player who refuses communication attemps via public chat a formspec to chat",
|
||||
privs = {},
|
||||
func = function(name, _)
|
||||
chat_formspec.show_create_new(name)
|
||||
end
|
||||
})
|
6
init.lua
6
init.lua
@ -5,9 +5,5 @@ local modpath = minetest.get_modpath(minetest.get_current_modname())
|
||||
dofile(modpath .. "/predefined_formspecs.lua")
|
||||
dofile(modpath .. "/specs.lua")
|
||||
dofile(modpath .. "/show-receive.lua")
|
||||
|
||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
print(dump(fields))
|
||||
end)
|
||||
|
||||
dofile(modpath .. "/chatcommands.lua")
|
||||
|
||||
|
Reference in New Issue
Block a user