2018-12-31 12:32:25 +00:00
|
|
|
dofile(minetest.get_modpath("ctf_playertag") .. "/api.lua")
|
2018-01-21 20:40:41 +00:00
|
|
|
|
|
|
|
ctf_flag.register_on_pick_up(function(attname, flag)
|
2019-04-09 08:31:18 +00:00
|
|
|
local tcolor = ctf_colors.get_color(ctf.player(attname))
|
2019-04-12 10:08:25 +00:00
|
|
|
ctf_playertag.set(minetest.get_player_by_name(attname),
|
|
|
|
ctf_playertag.TYPE_BUILTIN, tcolor.css)
|
2018-01-21 20:40:41 +00:00
|
|
|
end)
|
|
|
|
|
|
|
|
ctf_flag.register_on_drop(function(attname, flag)
|
2019-04-12 10:08:25 +00:00
|
|
|
ctf_playertag.set(minetest.get_player_by_name(attname),
|
|
|
|
ctf_playertag.TYPE_ENTITY)
|
2018-01-21 20:40:41 +00:00
|
|
|
end)
|
|
|
|
|
|
|
|
ctf_flag.register_on_capture(function(attname, flag)
|
2019-04-12 10:08:25 +00:00
|
|
|
ctf_playertag.set(minetest.get_player_by_name(attname),
|
|
|
|
ctf_playertag.TYPE_ENTITY)
|
2018-01-21 20:40:41 +00:00
|
|
|
end)
|
2018-08-20 10:23:42 +00:00
|
|
|
|
|
|
|
ctf_match.register_on_new_match(function()
|
2019-04-12 10:08:25 +00:00
|
|
|
for name, settings in pairs(ctf_playertag.get_all()) do
|
|
|
|
if settings.type == ctf_playertag.TYPE_BUILTIN then
|
|
|
|
ctf_playertag.set(minetest.get_player_by_name(name),
|
|
|
|
ctf_playertag.TYPE_ENTITY)
|
2018-08-20 10:23:42 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end)
|