yl_cities/chatcommand_player.lua
2025-06-04 22:34:46 +02:00

20 lines
849 B
Lua

local chatcommand_cmd = "player_example"
local chatcommand_definition = {
params = yl_template.t("chatcommand_player_parameters"), -- Short parameter description
description = yl_template.t("chatcommand_player_parameters"), -- Full description
privs = {privs = true}, -- Require the "privs" privilege to run
func = function(name, param)
local success = true
if success then
return true, yl_template.t("chatcommand_player_parameters")
else
return false, yl_template.t("chatcommand_player_parameters")
end
end
-- Called when command is run. Returns boolean success and text output.
-- Special case: The help message is shown to the player if `func`
-- returns false without a text output.
}
minetest.register_chatcommand(chatcommand_cmd, chatcommand_definition)