yl_cities/chatcommand_admin.lua
2025-06-04 23:49:37 +02:00

20 lines
870 B
Lua

local chatcommand_cmd = "admin_example"
local chatcommand_definition = {
params = yl_cities.t("chatcommand_admin_parameters"), -- Short parameter description
description = yl_cities.t("chatcommand_admin_description"), -- Full description
privs = {[yl_cities.settings.admin_priv] = true}, -- Require the "privs" privilege to run
func = function(name, param)
local success = true
if success then
return true, yl_cities.t("chatcommand_admin_success_message")
else
return false, yl_cities.t("chatcommand_admin_fail_message")
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)