Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
bc002667c8 | |||
b0d5b5abeb | |||
18a81fab6d |
@ -7,6 +7,7 @@ local disable = true
|
||||
local prevLap = 0
|
||||
local splits = {}
|
||||
local PATCH = nil
|
||||
local help = true
|
||||
|
||||
local Flags = 0
|
||||
|
||||
@ -91,20 +92,18 @@ else
|
||||
print("Failed to open file: ", FILENAME)
|
||||
end
|
||||
|
||||
local function initLeaderboard(player)
|
||||
local ingame = 0
|
||||
local function ingame()
|
||||
local n = 0
|
||||
for p in players.iterate do
|
||||
if p.valid and not p.spectator then
|
||||
ingame = ingame + 1
|
||||
n = $ + 1
|
||||
end
|
||||
end
|
||||
return n
|
||||
end
|
||||
|
||||
disable = ingame > 1
|
||||
|
||||
if disable then
|
||||
--print("To many players in game, leaderboard has been disabled")
|
||||
return
|
||||
end
|
||||
local function initLeaderboard(player)
|
||||
disable = ingame() > 1
|
||||
end
|
||||
addHook("PlayerSpawn", initLeaderboard)
|
||||
|
||||
@ -142,6 +141,11 @@ local function changelevel(player, ...)
|
||||
end
|
||||
|
||||
local map = ...
|
||||
if map == nil then
|
||||
CONS_Printf(player, "Usage: changelevel MAPXX")
|
||||
return
|
||||
end
|
||||
|
||||
local p, q = map:upper():match("MAP(%w)(%w)$", 1)
|
||||
if not (p and q) then
|
||||
CONS_Printf(player, string.format("Invalid map name: %s", map))
|
||||
@ -159,7 +163,7 @@ local function changelevel(player, ...)
|
||||
else
|
||||
--Extended map numbers
|
||||
p = ALPH:find(p) - 1
|
||||
q = (tonumber(q) or ALPH:find(q) + 10) - 1
|
||||
q = (tonumber(q) or ALPH:find(q) + 9)
|
||||
mapnum = 36 * p + q + 100
|
||||
end
|
||||
|
||||
@ -466,6 +470,7 @@ end
|
||||
|
||||
local function think()
|
||||
if disable then
|
||||
help = true
|
||||
return
|
||||
end
|
||||
if showSplit > 0 then
|
||||
@ -473,6 +478,18 @@ local function think()
|
||||
end
|
||||
|
||||
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)
|
||||
if leveltime > startTime - (3 * TICRATE) / 2 and server.SPBArunning then
|
||||
Flags = $ | F_SPBATK
|
||||
|
Reference in New Issue
Block a user