This commit is contained in:
Not 2022-03-28 13:11:21 +02:00
parent b0d5b5abeb
commit bc002667c8
1 changed files with 17 additions and 13 deletions

View File

@ -92,21 +92,18 @@ else
print("Failed to open file: ", FILENAME) print("Failed to open file: ", FILENAME)
end end
local function initLeaderboard(player) local function ingame()
local ingame = 0 local n = 0
for p in players.iterate do for p in players.iterate do
if p.valid and not p.spectator then if p.valid and not p.spectator then
ingame = ingame + 1 n = $ + 1
end end
end end
return n
disable = ingame > 1 end
if disable or ingame == 0 then local function initLeaderboard(player)
-- Print the help message next time someone is alone disable = ingame() > 1
help = true
return
end
end end
addHook("PlayerSpawn", initLeaderboard) addHook("PlayerSpawn", initLeaderboard)
@ -473,6 +470,7 @@ end
local function think() local function think()
if disable then if disable then
help = true
return return
end end
if showSplit > 0 then if showSplit > 0 then
@ -481,9 +479,15 @@ local function think()
if leveltime < startTime then if leveltime < startTime then
-- Help message -- Help message
if help and leveltime == startTime - TICRATE * 3 then if leveltime == startTime - TICRATE * 3 then
help = false if ingame() == 1 then
chatprint("\x89Leaderboard Commands:\nretry exit findmap changelevel spba_clearcheats", true) if help then
help = false
chatprint("\x89Leaderboard Commands:\nretry exit findmap changelevel spba_clearcheats", true)
end
else
help = true
end
end end
Flags = $ & !(F_SPBATK | F_SPBEXP | F_SPBBIG | F_SPBJUS) Flags = $ & !(F_SPBATK | F_SPBEXP | F_SPBBIG | F_SPBJUS)