local text_clr = Color(140, 0, 0, 180)

local local_ply
local function DrawBlackscreen()
	local_ply = local_ply or LocalPlayer()
	if !local_ply:getDarkRPVar("AFK") then return end
	surface.SetDrawColor(color_black)
	surface.DrawRect(-1, -1, ScrW() + 2, ScrH() + 2)
end
hook.Add("RenderScreenspaceEffects", "AFK_DrawHUD", DrawBlackscreen)

local function DrawAFKHUD()
	local_ply = local_ply or LocalPlayer()
	if !local_ply:getDarkRPVar("AFK") then return end
	local scrw = ScrW() / 2
	local scrh = ScrH() / 2
	draw.DrawNonParsedSimpleText(DarkRP.getPhrase("afk_mode"), "DarkRPHUD2", scrw, scrh - 100, text_clr, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
	draw.DrawNonParsedSimpleText(DarkRP.getPhrase("salary_frozen"), "DarkRPHUD2", scrw, scrh - 60, text_clr, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
	if !local_ply:getDarkRPVar("AFKDemoted") then
		draw.DrawNonParsedSimpleText(DarkRP.getPhrase("no_auto_demote"), "DarkRPHUD2", scrw, scrh - 20, text_clr, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
	else
		draw.DrawNonParsedSimpleText(DarkRP.getPhrase("youre_afk_demoted"), "DarkRPHUD2", scrw, scrh - 20, text_clr, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
	end
	draw.DrawNonParsedSimpleText(DarkRP.getPhrase("afk_cmd_to_exit"), "DarkRPHUD2", scrw, scrh + 20, text_clr, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
end
hook.Add("HUDPaintBackground", "AFK_DrawHUD", DrawAFKHUD)