forked from Not/srb2k-leaderboard
Compare commits
3 Commits
lonsfor-pa
...
14645dbc90
Author | SHA1 | Date | |
---|---|---|---|
14645dbc90 | |||
6c7cdf34b9 | |||
8a6161a1e1 |
@ -83,11 +83,24 @@ local cv_gui = CV_RegisterVar({
|
|||||||
PossibleValue = {Off = GUI_OFF, Splits = GUI_SPLITS, On = GUI_ON}
|
PossibleValue = {Off = GUI_OFF, Splits = GUI_SPLITS, On = GUI_ON}
|
||||||
})
|
})
|
||||||
|
|
||||||
local cv_afk = CV_RegisterVar({
|
local AntiAFK = true
|
||||||
|
CV_RegisterVar({
|
||||||
name = "lb_afk",
|
name = "lb_afk",
|
||||||
defaultvalue = 1,
|
defaultvalue = 1,
|
||||||
flags = CV_NETVAR,
|
flags = CV_NETVAR | CV_CALL,
|
||||||
PossibleValue = CV_OnOff
|
PossibleValue = CV_OnOff,
|
||||||
|
func = function(v)
|
||||||
|
-- Set players afkTime and toggle AntiAFK
|
||||||
|
if v.value then
|
||||||
|
for p in players.iterate do
|
||||||
|
p.afkTime = leveltime
|
||||||
|
end
|
||||||
|
|
||||||
|
AntiAFK = true
|
||||||
|
else
|
||||||
|
AntiAFK = false
|
||||||
|
end
|
||||||
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
local cv_enable = CV_RegisterVar({
|
local cv_enable = CV_RegisterVar({
|
||||||
@ -1146,7 +1159,7 @@ local function think()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if disable then
|
if disable then
|
||||||
if cv_afk.value then
|
if AntiAFK then
|
||||||
if ingame() > 1 then
|
if ingame() > 1 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
|
||||||
@ -1272,13 +1285,15 @@ local function think()
|
|||||||
p.afkTime = leveltime
|
p.afkTime = leveltime
|
||||||
end
|
end
|
||||||
|
|
||||||
if leveltime > PREVENT_JOIN_TIME and p.afkTime + AFK_TIMEOUT > leveltime then
|
if not replayplayback then
|
||||||
if cv_teamchange.value then
|
if leveltime > PREVENT_JOIN_TIME and p.afkTime + AFK_TIMEOUT > leveltime then
|
||||||
allowJoin(false)
|
if cv_teamchange.value then
|
||||||
end
|
allowJoin(false)
|
||||||
elseif p.afkTime + AFK_TIMEOUT < leveltime then
|
end
|
||||||
if not cv_teamchange.value then
|
elseif p.afkTime + AFK_TIMEOUT < leveltime then
|
||||||
allowJoin(true)
|
if not cv_teamchange.value then
|
||||||
|
allowJoin(true)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user