diff --git a/mods/ctf/ctf_modebase/features.lua b/mods/ctf/ctf_modebase/features.lua index ab53b1dea6..570eedce14 100644 --- a/mods/ctf/ctf_modebase/features.lua +++ b/mods/ctf/ctf_modebase/features.lua @@ -696,7 +696,17 @@ return { local pro_chest = player and player:get_meta():get_int("ctf_rankings:pro_chest:".. (ctf_modebase.current_mode or "")) == 1 local deny_pro = "You need to have more than 1.4 kills per death, ".. - "5 captures, and at least 8,000 score to access the pro section" + "5 captures, and at least 8,000 score to access the pro section." + if rank then + local captures_needed = math.max(0, 5 - (rank.flag_captures or 0)) + local score_needed = math.max(0, 8000 - (rank.score or 0)) + local current_kd = math.floor((rank.kills or 0) / (rank.deaths or 1) * 10) + current_kd = current_kd / 10 + deny_pro = deny_pro .. " You still need " .. captures_needed + .. " captures, " .. score_needed .. + " score, and your kills per death is " .. + current_kd .. "." + end -- Remember to update /make_pro in ranking_commands.lua if you change anything here if pro_chest or rank then diff --git a/mods/ctf/ctf_teams/team_chest.lua b/mods/ctf/ctf_teams/team_chest.lua index a6f8dbe38b..8bc8256716 100644 --- a/mods/ctf/ctf_teams/team_chest.lua +++ b/mods/ctf/ctf_teams/team_chest.lua @@ -122,7 +122,7 @@ for _, team in ipairs(ctf_teams.teamlist) do "label[7,-0.2;" .. minetest.formspec_escape("Pro players only") .. "]" else - formspec = formspec .. "label[6.5,3;" .. + formspec = formspec .. "label[6.5,2;" .. minetest.formspec_escape(minetest.wrap_text( pro_access or "You aren't allowed to access the pro section", 20