local show_alarm = CreateClientConVar("cl_showalarm", 1, FCVAR_ARCHIVE)
local local_ply, ent
local function DrawAlarm()
	if !show_alarm:GetBool() then return end
	local_ply = local_ply or LocalPlayer()
	ent = local_ply:GetEyeTrace().Entity
	if IsValid(ent) and ent:isDoor() then
		if !ent:GetNW2Bool("Secured") then return end
		local distance = local_ply:GetPos():DistToSqr(ent:GetPos())
		if distance > 40000 then return end
		local tm = local_ply:Team()
		local group = ent:getKeysDoorGroup()
		local teamown = ent:getKeysDoorTeams()
		if ent:isKeysOwnedBy(local_ply) or (group and table.HasValue(RPExtraTeamDoors[group] or {}, tm)) or (teamown and teamown[tm]) then
			draw.DrawText("Diese Tür ist mit einer Alarmanlage geschützt!", "Roboto20", ScrW() / 2 + 1, ScrH() * 0.4 + 1, color_black, TEXT_ALIGN_CENTER)
			draw.DrawText("Diese Tür ist mit einer Alarmanlage geschützt!", "Roboto20", ScrW() / 2, ScrH() * 0.4, Color(150, 150, 150, 255), TEXT_ALIGN_CENTER)
		end
	end
end
hook.Add("HUDPaint", "Alarm_DrawAlarm", DrawAlarm)