Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
bc002667c8 | |||
b0d5b5abeb |
@ -7,6 +7,7 @@ local disable = true
|
|||||||
local prevLap = 0
|
local prevLap = 0
|
||||||
local splits = {}
|
local splits = {}
|
||||||
local PATCH = nil
|
local PATCH = nil
|
||||||
|
local help = true
|
||||||
|
|
||||||
local Flags = 0
|
local Flags = 0
|
||||||
|
|
||||||
@ -91,20 +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 then
|
|
||||||
--print("To many players in game, leaderboard has been disabled")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
addHook("PlayerSpawn", initLeaderboard)
|
addHook("PlayerSpawn", initLeaderboard)
|
||||||
|
|
||||||
@ -142,6 +141,11 @@ local function changelevel(player, ...)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local map = ...
|
local map = ...
|
||||||
|
if map == nil then
|
||||||
|
CONS_Printf(player, "Usage: changelevel MAPXX")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local p, q = map:upper():match("MAP(%w)(%w)$", 1)
|
local p, q = map:upper():match("MAP(%w)(%w)$", 1)
|
||||||
if not (p and q) then
|
if not (p and q) then
|
||||||
CONS_Printf(player, string.format("Invalid map name: %s", map))
|
CONS_Printf(player, string.format("Invalid map name: %s", map))
|
||||||
@ -466,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
|
||||||
@ -473,6 +478,18 @@ local function think()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if leveltime < startTime then
|
if leveltime < startTime then
|
||||||
|
-- Help message
|
||||||
|
if leveltime == startTime - TICRATE * 3 then
|
||||||
|
if ingame() == 1 then
|
||||||
|
if help then
|
||||||
|
help = false
|
||||||
|
chatprint("\x89Leaderboard Commands:\nretry exit findmap changelevel spba_clearcheats", true)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
help = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
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