Compare commits
6 Commits
master
...
lonsfor-pa
Author | SHA1 | Date | |
---|---|---|---|
e25b417fbd | |||
3d54350dae | |||
89da89fbfe | |||
906444ae08 | |||
405a0e50f2 | |||
6ea3341b06 |
@ -78,7 +78,7 @@ local allowJoin
|
|||||||
|
|
||||||
local cv_gui = CV_RegisterVar({
|
local cv_gui = CV_RegisterVar({
|
||||||
name = "lb_gui",
|
name = "lb_gui",
|
||||||
defaultvalue = GUI_ON,
|
defaultvalue = "On",
|
||||||
flags = 0,
|
flags = 0,
|
||||||
PossibleValue = {Off = GUI_OFF, Splits = GUI_SPLITS, On = GUI_ON}
|
PossibleValue = {Off = GUI_OFF, Splits = GUI_SPLITS, On = GUI_ON}
|
||||||
})
|
})
|
||||||
@ -86,7 +86,7 @@ local cv_gui = CV_RegisterVar({
|
|||||||
local AntiAFK = true
|
local AntiAFK = true
|
||||||
CV_RegisterVar({
|
CV_RegisterVar({
|
||||||
name = "lb_afk",
|
name = "lb_afk",
|
||||||
defaultvalue = 1,
|
defaultvalue = "On",
|
||||||
flags = CV_NETVAR | CV_CALL,
|
flags = CV_NETVAR | CV_CALL,
|
||||||
PossibleValue = CV_OnOff,
|
PossibleValue = CV_OnOff,
|
||||||
func = function(v)
|
func = function(v)
|
||||||
@ -105,7 +105,7 @@ CV_RegisterVar({
|
|||||||
|
|
||||||
local cv_enable = CV_RegisterVar({
|
local cv_enable = CV_RegisterVar({
|
||||||
name = "lb_enable",
|
name = "lb_enable",
|
||||||
defaultvalue = 1,
|
defaultvalue = "On",
|
||||||
flags = CV_NETVAR | CV_CALL,
|
flags = CV_NETVAR | CV_CALL,
|
||||||
PossibleValue = CV_OnOff,
|
PossibleValue = CV_OnOff,
|
||||||
func = function(v)
|
func = function(v)
|
||||||
@ -125,7 +125,7 @@ local cv_saves = CV_RegisterVar({
|
|||||||
|
|
||||||
local cv_interrupt = CV_RegisterVar({
|
local cv_interrupt = CV_RegisterVar({
|
||||||
name = "lb_interrupt",
|
name = "lb_interrupt",
|
||||||
defaultvalue = 0,
|
defaultvalue = "Off",
|
||||||
flags = CV_NETVAR | CV_CALL,
|
flags = CV_NETVAR | CV_CALL,
|
||||||
PossibleValue = CV_OnOff,
|
PossibleValue = CV_OnOff,
|
||||||
func = function(v)
|
func = function(v)
|
||||||
@ -193,7 +193,7 @@ end
|
|||||||
|
|
||||||
local cv_spb_separate = CV_RegisterVar({
|
local cv_spb_separate = CV_RegisterVar({
|
||||||
name = "lb_spb_combined",
|
name = "lb_spb_combined",
|
||||||
defaultvalue = 1,
|
defaultvalue = "On",
|
||||||
flags = CV_NETVAR | CV_CALL,
|
flags = CV_NETVAR | CV_CALL,
|
||||||
PossibleValue = CV_YesNo,
|
PossibleValue = CV_YesNo,
|
||||||
func = function(v)
|
func = function(v)
|
||||||
@ -297,36 +297,39 @@ end
|
|||||||
|
|
||||||
function allowJoin(v)
|
function allowJoin(v)
|
||||||
if not cv_interrupt.value then
|
if not cv_interrupt.value then
|
||||||
local y
|
|
||||||
if v then
|
if v then
|
||||||
y = "yes"
|
COM_BufInsertText(server, "allowteamchange Yes")
|
||||||
hud.enable("freeplay")
|
hud.enable("freeplay")
|
||||||
else
|
else
|
||||||
y = "no"
|
COM_BufInsertText(server, "allowteamchange No")
|
||||||
hud.disable("freeplay")
|
hud.disable("freeplay")
|
||||||
end
|
end
|
||||||
|
|
||||||
COM_BufInsertText(server, "allowteamchange " + y)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function ingame()
|
local function TwoPlusInGame()
|
||||||
local n = 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
|
||||||
n = $ + 1
|
n = $ + 1
|
||||||
|
if n == 2 then
|
||||||
|
return true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return n
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
local function initLeaderboard(player)
|
local function initLeaderboard(player)
|
||||||
if disable and leveltime < START_TIME then
|
if cv_enable.value and G_RaceGametype() then
|
||||||
disable = ingame() > 1
|
if disable and leveltime < START_TIME then
|
||||||
|
disable = TwoPlusInGame()
|
||||||
|
else
|
||||||
|
disable = $ or TwoPlusInGame()
|
||||||
|
end
|
||||||
else
|
else
|
||||||
disable = disable or ingame() > 1
|
disable = true
|
||||||
end
|
end
|
||||||
disable = $ or not cv_enable.value
|
|
||||||
|
|
||||||
-- Restore encore mode to initial value
|
-- Restore encore mode to initial value
|
||||||
if disable and EncoreInitial != nil then
|
if disable and EncoreInitial != nil then
|
||||||
@ -339,7 +342,7 @@ end
|
|||||||
addHook("PlayerSpawn", initLeaderboard)
|
addHook("PlayerSpawn", initLeaderboard)
|
||||||
|
|
||||||
local function doyoudare(player)
|
local function doyoudare(player)
|
||||||
if ingame() > 1 or player.spectator then
|
if TwoPlusInGame() or player.spectator then
|
||||||
CONS_Printf(player, "How dare you")
|
CONS_Printf(player, "How dare you")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@ -1160,7 +1163,7 @@ local function think()
|
|||||||
|
|
||||||
if disable then
|
if disable then
|
||||||
if AntiAFK then
|
if AntiAFK then
|
||||||
if ingame() > 1 then
|
if TwoPlusInGame() then
|
||||||
for p in players.iterate do
|
for p in players.iterate do
|
||||||
if p.valid and not p.spectator and not p.exiting and p.lives > 0 then
|
if p.valid and not p.spectator and not p.exiting and p.lives > 0 then
|
||||||
if p.cmd.buttons then
|
if p.cmd.buttons then
|
||||||
@ -1197,7 +1200,7 @@ local function think()
|
|||||||
if leveltime < START_TIME then
|
if leveltime < START_TIME then
|
||||||
-- Help message
|
-- Help message
|
||||||
if leveltime == START_TIME - TICRATE * 3 then
|
if leveltime == START_TIME - TICRATE * 3 then
|
||||||
if ingame() == 1 then
|
if p then
|
||||||
if help then
|
if help then
|
||||||
help = false
|
help = false
|
||||||
chatprint(HELP_MESSAGE, true)
|
chatprint(HELP_MESSAGE, true)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user