Stop players from taking flags in build time

This commit is contained in:
rubenwardy 2015-11-28 01:25:25 +00:00
parent 47f9da7041
commit a352454b28
2 changed files with 11 additions and 1 deletions

View file

@ -66,6 +66,16 @@ ctf_match.register_on_build_time_end(function()
end
end)
ctf_flag.register_on_prepick_up(function(name, flag)
if ctf_match.is_in_build_time() then
minetest.chat_send_player(name, "Match hasn't started yet!")
ctf.move_to_spawn(name)
return false
else
return true
end
end)
ctf.hud.register_part(function(player, name, tplayer)
if ctf_match.build_timer <= 0 then
ctf.hud:remove(player, "ctf_match:countdown")