-minetest.register_chatcommand("setnews", {
- params = "<news>",
- description = "Set news",
- privs = {server = true},
- func = function(player, param)
- elidragon.savedata.news = param
- end,
-})
minetest.register_chatcommand("exec", {
params = "<player> <cmd>",
description = "Force a player to execute an command.",
privs = {server = true},
- func = function(player, param)
- if param:split(' ') and minetest.chatcommands[param:split(' ')[2]] then
- minetest.chatcommands[param:split(' ')[2]].func(param:split(' ')[1])
- end
+ func = function(name, param)
+ minetest.chat_send_player(name, "/exec is deprecated. Use /sudo instead")
+ minetest.chatcommands["sudo"].func(name, param)
end,
})
minetest.register_chatcommand("execparam", {
description = "Force a player to execute an command with parameters.",
privs = {server = true},
func = function(player, param)
- minetest.chatcommands[param:split('-')[2]].func(param:split('-')[1],param:split('-')[3])
+ minetest.chat_send_player(name, "/execparam is deprecated. Use /sudo instead")
+ minetest.chatcommands["sudo"].func(name, param:gsub("-", " "))
end,
})
minetest.register_chatcommand("message", {
})
minetest.register_chatcommand("colormsg", {
params = "[[<player>-]color>-]<message>",
- description = "Send a message as the server. [deprecated, replaced my the message command]",
+ description = "Send a message as the server. [deprecated, replaced by the message command]",
privs = {server = true},
func = function(name, param)
elidragon.message(param)
func = function(name, param)
local target = param:split(" ")[1]
local command = param:split(" ")[2]
- local arguments
local argumentsdisp
local cmddef = minetest.chatcommands
- _, _, arguments = string.match(param, "([^ ]+) ([^ ]+) (.+)")
+ local _, _, arguments = string.match(param, "([^ ]+) ([^ ]+) (.+)")
if not arguments then arguments = "" end
if target and command then
if cmddef[command] then
end
end
})
+
+minetest.register_chatcommand("getip", {
+ description = "Get the IP of a player",
+ params = "<player>",
+ privs = {server = true},
+ func = function(name, param)
+ if minetest.get_player_by_name(param) then
+ minetest.chat_send_player(name, "IP of " .. param .. ": " .. minetest.get_player_information(param).address)
+ else
+ minetest.chat_send_player(name, "Player is not online.")
+ end
+ end
+})