convert /re and /away to 'real' commands, depending on shout priv

This commit is contained in:
tchncs 2016-06-08 19:25:43 +02:00
parent f82df4fb45
commit 2d85e04b4d

View File

@ -10,13 +10,36 @@ minetest.register_chatcommand("spawn", {
minetest.chat_send_player(name, "Teleporting to Spawnpoint...")
end,
})
minetest.register_chatcommand("away", {
params = "<player>",
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 = "<player>",
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"