diff options
author | rubenwardy <rubenwardy@gmail.com> | 2015-06-10 17:45:18 +0100 |
---|---|---|
committer | rubenwardy <rubenwardy@gmail.com> | 2016-07-29 15:58:30 +0100 |
commit | 85efc6704932898bf6c98ff5c043a989ce83f293 (patch) | |
tree | 3a8384a43b57dee609b3fb7bf893083c62eaba7e /chat_commands.lua | |
parent | 85a40d24880964dfdf6c3e0db92ce5b9bbca0dc5 (diff) |
Move helpers and chat commands to separate files
Diffstat (limited to 'chat_commands.lua')
-rw-r--r-- | chat_commands.lua | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/chat_commands.lua b/chat_commands.lua new file mode 100644 index 0000000..e5c6959 --- /dev/null +++ b/chat_commands.lua @@ -0,0 +1,37 @@ +minetest.register_chatcommand("list_awards", { + params = "obsolete", + description = "list_awards: obsolete. Use /awards", + func = function(name, param) + minetest.chat_send_player(name, "This command has been made obsolete. Use /awards instead.") + awards.showto(name, name, nil, false) + end +}) + +minetest.register_chatcommand("awards", { + params = "", + description = "awards: list awards", + func = function(name, param) + awards.showto(name, name, nil, false) + end +}) + +minetest.register_chatcommand("cawards", { + params = "", + description = "awards: list awards in chat", + func = function(name, param) + awards.showto(name, name, nil, true) + end +}) + +minetest.register_chatcommand("awd", { + params = "award name", + description = "awd: Details of awd gotten", + func = function(name, param) + local def = awards.def[param] + if def then + minetest.chat_send_player(name,def.title..": "..def.description) + else + minetest.chat_send_player(name,"Award not found.") + end + end +}) |