-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
108 lines (80 loc) · 2.37 KB
/
Copy pathinit.lua
File metadata and controls
108 lines (80 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
--[[
Arena Fighting equipment
register some wapons an armor for the fight in an arena
if plyer is leaving the arena the mod will remove the toos / armor of the player inventory
Copyright (c) 2017
ralf Weinert <downad@freenet.de>
Source Code:
https://github.com/downad/aftools
License: GPLv2.1
]]--
-- ModName
local THISMOD = minetest.get_current_modname()
-- ModPath
local THISMODPATH = minetest.get_modpath(THISMOD)
-- function print_log to print a info on the screen
function print_log(printstring, withIntro)
if withIntro > 0 then
print("[MOD]"..THISMOD)
end
print(" "..printstring)
end
-- load the aftools lib
dofile(THISMODPATH.."/aftools_lib.lua");
minetest.log("action", "[MOD]"..THISMOD.." -- loaded aftools_lib")
-- register tools
dofile(THISMODPATH.."/default_tools.lua");
minetest.log("action", "[MOD]"..THISMOD.." -- loaded default-tools")
-- are these mods present?
local mod_3d_armor = minetest.get_modpath("3d_armor")
-- if yes - dofile
if mod_3d_armor then
dofile(THISMODPATH.."/3d_armor.lua");
minetest.log("action", "[MOD]"..THISMOD.." -- loaded 3d-Armor")
end
local mod_pvp_areas = minetest.get_modpath("pvp_areas")
-- if yes - dofile
if mod_pvp_areas then
-- dofile(THISMODPATH.."/3d_armor.lua");
minetest.log("action", "[MOD]"..THISMOD.." -- pvp-areas is present")
end
-- register armor
-- load mod weapons
dofile(THISMODPATH.."/weapons.lua");
-- load mod armor
-- load remove aftools functions
dofile(THISMODPATH.."/remove_aftools.lua");
-- Globalstep - test if player is in an pvp-Area
-- use AreaStore of pvp_area
-- every 5 seconds
local timer = 0
minetest.register_globalstep(function(dtime)
timer = timer + dtime;
if timer >= 5 then
for _, player in ipairs(minetest.get_connected_players()) do
if mod_pvp_areas then
IsPlayerInTheArena(player, false)
end
end
timer = 0
end
end)
--[[
minetest.register_globalstep(function(dtime)
for _, player in ipairs(minetest.get_connected_players()) do
if mod_pvp_areas then
IsPlayerInTheArena(player, false)
end
end
end)
]]--
-- remove arenaTools on join
minetest.register_on_joinplayer(function(player)
IsPlayerInTheArena(player, true)
end)
-- remove arenaTools on join
minetest.register_on_leaveplayer(function(player)
IsPlayerInTheArena(player, true)
end)
-- log that the mod is loades
minetest.log("action", "[MOD]"..THISMOD.." -- loaded!")