local missingtextures = CreateClientConVar("cl_missingtextures", 1, FCVAR_ARCHIVE)
timer.Simple(60, function()
	hook.Add("HUDPaint", "cl_missingtextures", function()
		if !missingtextures:GetBool() then return end
		if !IsMounted("cstrike") and !util.IsValidModel("models/props/cs_assault/money.mdl") then
			local scrw, scrh, color = ScrW() / 2, 100, Color(255, 78, 78)
			draw.SimpleTextOutlined("ACHTUNG:", "DermaLarge", scrw, scrh, color, TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, color_black)
			draw.SimpleTextOutlined("Dir fehlen Inhalte um auf diesem Server fehlerfrei spielen zu können!", "mg_instructions", scrw, scrh + 35, color, TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, color_black)
			draw.SimpleTextOutlined("Fehlender Inhalt: Counter Strike Source", "mg_instructions", scrw, scrh + 55, color, TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, color_black)
			draw.SimpleTextOutlined("Diese Nachricht lässt sich über den Chatbefehl \"!cmsg\" deaktivieren.", "mg_instructions2", scrw, scrh + 80, color, TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP, 1, color_black)
		else
			hook.Remove("HUDPaint", "cl_missingtextures")
		end
	end, HOOK_MONITOR_LOW or 2)
end)

hook.Add("OnPlayerChat", "cl_missingtextures", function(ply, text)
	if string.lower(text) == "!cmsg" then
		if ply == LocalPlayer() then
			RunConsoleCommand("cl_missingtextures", "0")
		end
		return true
	end
end)

timer.Simple(1800, function()
	hook.Remove("HUDPaint", "cl_missingtextures")
	hook.Remove("OnPlayerChat", "cl_missingtextures")
end)