Skip to content

Commit df2980b

Browse files
committed
new tecture from tm, distance in hud, fied chat spam
1 parent 095f441 commit df2980b

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

depends.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
technic
2+
moreores
3+

init.lua

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,17 @@ minetest.register_craft({
1616
})
1717

1818
minetest.register_node("aviator:aviator", {
19-
description = "aviation device",
20-
tiles = {"aviator_node.png"},
19+
description = "aviation device, fly priv for 10min",
20+
tiles = {"aviator_aviator_top.png",
21+
"aviator_aviator_bottom.png",
22+
"aviator_aviator_side.png",
23+
"aviator_aviator_side.png",
24+
"aviator_aviator_side.png",
25+
"aviator_aviator_side.png"},
2126
is_ground_content = false,
2227
diggable = false,
23-
groups = {cracky=3, stone=1}, --, not_in_creative_inventory=1},
28+
groups = {cracky=3, stone=1},
29+
light_source = 12,
2430

2531
on_place = function(itemstack, placer, pointed_thing)
2632
local name = placer:get_player_name()
@@ -73,15 +79,17 @@ minetest.register_globalstep(function(dtime)
7379
privs.fly = true
7480
minetest.set_player_privs(name, privs)
7581
else
76-
minetest.chat_send_player(name, core.colorize('#eeee00',"You left fly area ! "))
82+
if distance > maxdistance and distance < (maxdistance+10) then
83+
minetest.chat_send_player(name, core.colorize('#eeee00',"You left fly area ! "))
84+
end
7785
privs.fly = nil
7886
minetest.set_player_privs(name, privs)
7987
end
8088
if leftover > 10 then
8189
aviator_hud_id[name] = player:hud_add({
8290
hud_elem_type = "text";
8391
position = {x=0.5, y=0.80};
84-
text = ">>> "..math.floor(leftover/60).." minutes left <<<";
92+
text = ">>> "..math.floor(leftover/60).." minutes left, Distance: "..distance.." <<<";
8593
number = 0xFFFF00;})
8694
end
8795
if leftover <= 10 then

textures/aviator_aviator_bottom.png

456 Bytes
Loading

textures/aviator_aviator_side.png

669 Bytes
Loading

textures/aviator_aviator_top.png

645 Bytes
Loading

0 commit comments

Comments
 (0)