diff --git a/commands.lua b/commands.lua index d1283c0..999ee8b 100644 --- a/commands.lua +++ b/commands.lua @@ -10,13 +10,36 @@ minetest.register_chatcommand("spawn", { minetest.chat_send_player(name, "Teleporting to Spawnpoint...") end, }) + +minetest.register_chatcommand("away", { + params = "", + privs = {shout=true}, + description = "tell the people that you be away now", + func = function(name, param) + local player = minetest.env:get_player_by_name(name) + minetest.chat_send_all(name.." is now away from keyboard!") + irc:say(string.format('*** %s is now away from keyboard.', player:get_player_name())) + end, +}) + +minetest.register_chatcommand("re", { + params = "", + privs = {shout=true}, + description = "tell the people that you be back now", + func = function(name, param) + local player = minetest.env:get_player_by_name(name) + minetest.chat_send_all(name.." is no longer away from keyboard!") + irc:say(string.format('*** %s is no longer away from keyboard.', player:get_player_name())) + end, +}) + --[[ local cmd ="/away" if message:sub(0, #cmd) == cmd then if message == '/away' then local player = minetest.env:get_player_by_name(name) minetest.chat_send_all(name.." is now away from keyboard!") irc:say(string.format('*** %s is now away from keyboard.', player:get_player_name())) - return true --deds to sfan5 + return true end end local cmd ="/re"