Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
36134572af | |||
bc002667c8 |
@ -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
|
||||||
|
end
|
||||||
|
|
||||||
disable = ingame > 1
|
local function initLeaderboard(player)
|
||||||
|
disable = ingame() > 1
|
||||||
if disable or ingame == 0 then
|
|
||||||
-- Print the help message next time someone is alone
|
|
||||||
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,11 +479,35 @@ 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
|
||||||
|
if ingame() == 1 then
|
||||||
|
if help then
|
||||||
help = false
|
help = false
|
||||||
chatprint("\x89Leaderboard Commands:\nretry exit findmap changelevel spba_clearcheats", true)
|
chatprint("\x89Leaderboard Commands:\nretry exit findmap changelevel spba_clearcheats", true)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
help = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Autospec
|
||||||
|
if leveltime == 1 then
|
||||||
|
local gamer = nil
|
||||||
|
for p in players.iterate do
|
||||||
|
if p.valid and not p.spectator then
|
||||||
|
gamer = #p
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if gamer then
|
||||||
|
for p in players.iterate do
|
||||||
|
if p.valid and p.spectator then
|
||||||
|
COM_BufInsertText(p, string.format("view \"%d\"", gamer))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Gamemode flags
|
||||||
Flags = $ & !(F_SPBATK | F_SPBEXP | F_SPBBIG | F_SPBJUS)
|
Flags = $ & !(F_SPBATK | F_SPBEXP | F_SPBBIG | F_SPBJUS)
|
||||||
if leveltime > startTime - (3 * TICRATE) / 2 and server.SPBArunning then
|
if leveltime > startTime - (3 * TICRATE) / 2 and server.SPBArunning then
|
||||||
Flags = $ | F_SPBATK
|
Flags = $ | F_SPBATK
|
||||||
|
Reference in New Issue
Block a user