Add camera privilege in order to use camera commands

This commit is contained in:
sys4-fr 2019-02-10 01:17:28 +01:00
parent ca268ec9b9
commit e106ac96f9
1 changed files with 4 additions and 0 deletions

View File

@ -1,3 +1,4 @@
minetest.register_privilege("camera", { description = "Can use camera commands" })
local recordings = {} local recordings = {}
-- [function] Load recordings -- [function] Load recordings
@ -251,6 +252,9 @@ minetest.register_chatcommand("camera", {
description = "Manipulate recording", description = "Manipulate recording",
params = "<option> <value>", params = "<option> <value>",
func = function(name, param) func = function(name, param)
if not minetest.check_player_privs(name, { camera = true }) then
return false, "You need camera privilege!"
end
local player = minetest.get_player_by_name(name) local player = minetest.get_player_by_name(name)
local param1, param2 = param:split(" ")[1], param:split(" ")[2] local param1, param2 = param:split(" ")[1], param:split(" ")[2]