capturetheflag/mods/playertag/init.lua
ClobberXD 72c5afab55 Fix vote related bugs
* Reset playertag on new match
* Clear votes on new match
2018-08-20 11:23:42 +01:00

22 lines
730 B
Lua

dofile(minetest.get_modpath("playertag") .. "/api.lua")
ctf_flag.register_on_pick_up(function(attname, flag)
playertag.set(minetest.get_player_by_name(attname), playertag.TYPE_BUILTIN,
{ a=255, r=255, g=0, b=0 })
end)
ctf_flag.register_on_drop(function(attname, flag)
playertag.set(minetest.get_player_by_name(attname), playertag.TYPE_ENTITY)
end)
ctf_flag.register_on_capture(function(attname, flag)
playertag.set(minetest.get_player_by_name(attname), playertag.TYPE_ENTITY)
end)
ctf_match.register_on_new_match(function()
for name, settings in pairs(playertag.get_all()) do
if settings.type == playertag.TYPE_BUILTIN then
playertag.set(minetest.get_player_by_name(name), playertag.TYPE_ENTITY)
end
end
end)