mirror of
https://github.com/APercy/airutils.git
synced 2025-03-21 18:41:21 +00:00
added priv validation for a plane
This commit is contained in:
parent
aa2f00212e
commit
8e6a39ec81
2 changed files with 10 additions and 1 deletions
|
@ -586,7 +586,8 @@ function airutils.on_punch(self, puncher, ttime, toolcaps, dir, damage)
|
||||||
|
|
||||||
-- lets permit destroying on the air
|
-- lets permit destroying on the air
|
||||||
local is_flying = not self.colinfo.touching_ground
|
local is_flying = not self.colinfo.touching_ground
|
||||||
if is_flying and not puncher:is_player() then
|
--if is_flying and not puncher:is_player() then
|
||||||
|
if not puncher:is_player() then
|
||||||
damage_vehicle(self, toolcaps, ttime, damage)
|
damage_vehicle(self, toolcaps, ttime, damage)
|
||||||
end
|
end
|
||||||
--end
|
--end
|
||||||
|
|
|
@ -55,6 +55,14 @@ end
|
||||||
|
|
||||||
-- attach player
|
-- attach player
|
||||||
function airutils.attach(self, player, instructor_mode)
|
function airutils.attach(self, player, instructor_mode)
|
||||||
|
if self._needed_licence then
|
||||||
|
local can_fly = minetest.check_player_privs(player, self._needed_licence)
|
||||||
|
if not can_fly then
|
||||||
|
minetest.chat_send_player(player:get_player_name(), core.colorize('#ff0000', ' >>> You need trhe priv "'..self._needed_licence..'" to fly this plane.'))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
instructor_mode = instructor_mode or false
|
instructor_mode = instructor_mode or false
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
self.driver_name = name
|
self.driver_name = name
|
||||||
|
|
Loading…
Add table
Reference in a new issue