Add userlimit skip if sufficient score
This commit is contained in:
parent
15653f7648
commit
d66cabe446
4 changed files with 30 additions and 11 deletions
2
mods/ctf_userlimit/depends.txt
Normal file
2
mods/ctf_userlimit/depends.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
ctf
|
||||
ctf_stats
|
8
mods/ctf_userlimit/init.lua
Normal file
8
mods/ctf_userlimit/init.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
minetest.register_can_bypass_userlimit(function(name, ip)
|
||||
local pstat, discard = ctf_stats.player_or_nil(name)
|
||||
local actual_max_users = tonumber(minetest.settings:get("max_users")) +
|
||||
tonumber(minetest.settings:get("max_extra_users") or "10")
|
||||
local req_score = tonumber(minetest.settings:get("userlimit_bypass_required_score") or "10000")
|
||||
|
||||
return pstat and pstat.score > req_score and #minetest.get_connected_players() < actual_max_users
|
||||
end)
|
Loading…
Add table
Add a link
Reference in a new issue