Add cartographer privilege for using the /map command

This commit is contained in:
Hugues Ross 2020-06-13 09:08:01 -04:00
parent bd3521d439
commit dd5a620393

View File

@ -6,12 +6,20 @@ local chunk, audio, map_formspec = ...;
local MAXINT = 2147483647;
minetest.register_privilege("cartographer", {
description = "Allows use of the /map command to view local area maps",
give_to_singleplayer = true,
give_to_admin = true,
});
-- /map <detail> <scale> -- Displays a regional map around the player
-- (Optional)detail: Specifies the map's detail level. Defaults to the highest
-- available detail.
-- (Optional)scale: Specifies the map's scale. Defaults to 1.
minetest.register_chatcommand("map", {
params = "[<detail>] [<scale>]",
description = "Display a mapo of the local area",
privs = { cartographer = true },
func = function(name, param)
local detail, scale = param:match("(%d*) (%d*)");