mirror of
https://github.com/APercy/automobiles_pck
synced 2025-06-17 22:38:01 +02:00
fixed painting only by owner or server admin
This commit is contained in:
parent
8e6cba2238
commit
7a73f477b0
@ -468,6 +468,12 @@ minetest.register_node("automobiles_lib:light", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
function automobiles_lib.set_paint(self, puncher, itmstck)
|
function automobiles_lib.set_paint(self, puncher, itmstck)
|
||||||
|
local is_admin = false
|
||||||
|
is_admin = minetest.check_player_privs(puncher, {server=true})
|
||||||
|
if not (self.owner == puncher:get_player_name() or is_admin == true) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local item_name = ""
|
local item_name = ""
|
||||||
if itmstck then item_name = itmstck:get_name() end
|
if itmstck then item_name = itmstck:get_name() end
|
||||||
|
|
||||||
|
@ -254,6 +254,12 @@ local function paint(self, colstr)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function trans_am.set_paint(self, puncher, itmstck)
|
function trans_am.set_paint(self, puncher, itmstck)
|
||||||
|
local is_admin = false
|
||||||
|
is_admin = minetest.check_player_privs(puncher, {server=true})
|
||||||
|
if not (self.owner == puncher:get_player_name() or is_admin == true) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local item_name = ""
|
local item_name = ""
|
||||||
if itmstck then item_name = itmstck:get_name() end
|
if itmstck then item_name = itmstck:get_name() end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user