Neue Neue Deathrun Autokill

Hey everyone,

So I am using the deathrun gamemode made by arizard: https://github.com/Arizard/deathrun

And I am trying to find out if there is a way to disable the auto slay feature for when players are AFK. This feature is very bugged and starts auto slay in spawn when a new player is connecting to the server.

So does anyone know how to fully disable that feature? Been trying to look through the Lua files, but can’t seem to find where it is at.

I suspect that it might be this part in the file (sh_definerounds.lua) line 304:


ROUND:AddState( ROUND_ACTIVE,
	function()
		print("Round State: ACTIVE")
		hook.Call("DeathrunBeginActive", nil )
		if SERVER then
			ROUND:SetTimer( GetConVarNumber("deathrun_round_duration") )

			timer.Create("DeathrunAutoslay", GetConVarNumber("deathrun_autoslay_delay") + 5, 1, function()
				for k,v in ipairs(player.GetAllPlaying()) do
					local idletime = DR:CheckIdleTime( v )
					print( v, idletime )
					if idletime > GetConVarNumber("deathrun_autoslay_delay") then
						net.Start("DeathrunSpectatorNotification")
						net.Send( v )
						if v:Team() == TEAM_DEATH then
							DR:ChatBroadcast("Player "..v:Nick().." went AFK during a Death round! They will be punished.")
							DR:PunishDeathAvoid( v, GetConVarNumber("deathrun_death_avoid_punishment") )
						end
						v:ConCommand("deathrun_spectate_only 1")
					end
				end
			end)
		end
	end,
	function()
		if SERVER then
			local playing = player.GetAllPlaying()

			if #playing < 2 then
				ROUND:RoundSwitch( ROUND_WAITING )
				return
			end
			local deaths = {}
			local runners = {}

			for k,v in ipairs( playing ) do
				if v:Alive() then
					if v:Team() == TEAM_RUNNER then
						table.insert(runners, v)
					elseif v:Team() == TEAM_DEATH then
						table.insert( deaths, v )
					end
				end
			end

			if (#deaths == 0 and #runners == 0) or ROUND:GetTimer() == 0 then
				ROUND:FinishRound( WIN_STALEMATE )
			elseif #deaths == 0 then
				ROUND:FinishRound( WIN_RUNNER )
			elseif #runners == 0 then
				ROUND:FinishRound( WIN_DEATH )
			end

		end
	end,
	function()
		print("Exiting: ACTIVE")
	end
)

However, I don’t want to touch anything in case I break something.

I would appreciate any help I can get! =)

I mean you can just set the ConVar “deathrun_autoslay_delay” to a really high number.



timer.Create("DeathrunAutoslay", GetConVarNumber("deathrun_autoslay_delay") + 5, 1, function()
				for k,v in ipairs(player.GetAllPlaying()) do
					local idletime = DR:CheckIdleTime( v )
					print( v, idletime )
					if idletime > GetConVarNumber("deathrun_autoslay_delay") then
						net.Start("DeathrunSpectatorNotification")
						net.Send( v )
						if v:Team() == TEAM_DEATH then
							DR:ChatBroadcast("Player "..v:Nick().." went AFK during a Death round! They will be punished.")
							DR:PunishDeathAvoid( v, GetConVarNumber("deathrun_death_avoid_punishment") )
						end
						v:ConCommand("deathrun_spectate_only 1")
					end
				end
			end)


Removing this should work.

That doesn’t work, unfortunately. Since the issue is that the auto slay gets triggered when another player connects to the server (Every time).

[editline]5th August 2017[/editline]

I will try that, thanks! =)

Oh, didn’t catch that bit. Removing that timer should work though. Hopefully that won’t break anything. :slight_smile:

No problem! =) Yepp, seems to work perfectly.