2021-05-29 17:12:33 +03:00
|
|
|
local S = minetest.get_translator(minetest.get_current_modname())
|
2019-03-07 23:14:30 +03:00
|
|
|
|
2017-12-13 02:30:23 +03:00
|
|
|
minetest.register_privilege("maphack", {
|
2019-03-07 23:14:30 +03:00
|
|
|
description = S("Can place and use advanced blocks like mob spawners, command blocks and barriers."),
|
2017-12-13 02:30:23 +03:00
|
|
|
})
|
2021-09-19 14:15:19 +03:00
|
|
|
|
|
|
|
minetest.register_on_joinplayer(function(player)
|
2021-09-19 14:18:09 +03:00
|
|
|
local name = player:get_player_name()
|
2021-09-19 14:28:07 +03:00
|
|
|
local fly = nil
|
2021-09-19 14:15:19 +03:00
|
|
|
if minetest.is_creative_enabled(name) then
|
|
|
|
fly = true
|
|
|
|
end
|
|
|
|
minetest.set_player_privs(name, {
|
|
|
|
fly = fly,
|
|
|
|
})
|
|
|
|
end)
|