/helpcmdplus -> /commands and converted to real command, depending on shout, extendet output

master
tchncs 2016-06-08 19:36:11 +02:00
parent 2d85e04b4d
commit ef633e3130
1 changed files with 15 additions and 58 deletions

View File

@ -33,64 +33,21 @@ minetest.register_chatcommand("re", {
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
end
end
local cmd ="/re"
if message:sub(0, #cmd) == cmd then
if message == '/re' then
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()))
return true
end
end
local cmd ="/hacmd"
if message:sub(0, #cmd) == cmd then
if message == '/hacmd' then
--local player = minetest.env:get_player_by_name(name)
minetest.chat_send_all("additional Commands")
minetest.chat_send_all("===================")
minetest.chat_send_all("use /away for afk note from server.")
minetest.chat_send_all("use /re for no-longer-afk note from server.")
minetest.chat_send_all("use /spawn to teleporting you to the spawnpoint.")
minetest.chat_send_all("use /helpcmdplus to show this helpmessage.")
return true
end
end
local cmd ="/helpcmdplus"
if message:sub(0, #cmd) == cmd then
if message == '/helpcmdplus' then
local player = minetest.env:get_player_by_name(name)
minetest.chat_send_all("additional Comands")
minetest.chat_send_all("==================")
minetest.chat_send_player(player:get_player_name(),"use /away for afk note from server.")
minetest.chat_send_player(player:get_player_name(),"use /re for no-longer-afk note from server.")
minetest.chat_send_player(player:get_player_name(),"use /spawn to teleporting you to the Spawnpoint.")
return true
end
end
end)
--Deds to Kahrl
minetest.register_on_newplayer(function(player)
player:setpos(spawn)
return true
end)
--Deds to Kahrl
minetest.register_on_respawnplayer(function(player, pos)
player:setpos(spawn)
return true
end)
--]]
minetest.register_chatcommand("commands", {
params = "<player>",
privs = {shout=true},
description = "tells you some available commands",
func = function(name, param)
minetest.chat_send_player(name, "use /away for public afk note from server.")
minetest.chat_send_player(name, "use /re for public no-longer-afk note from server.")
minetest.chat_send_player(name, "use /sethome to set your homepoint.")
minetest.chat_send_player(name, "use /home to go back to your homepoint.")
minetest.chat_send_player(name, "use /spawn to teleporting you to the spawnpoint.")
minetest.chat_send_player(name, "use /help see the full list of available commands.")
minetest.chat_send_player(name, "use /help <command> for command info.")
minetest.chat_send_player(name, "use /commands to show this helpmessage.")
end,
})
-- Commands, originally by Grailtest @0-afflatus