Permanently locking certain doors

Is there a way to perma lock doors(without editing map), or at least modify the lockpick and battering ram so that they can’t open certain doors if it belongs to a certain door group?

If you want to avoid modifying dozen scripts for a general purpose solution I would probably do something like this:

[lua]
local DoorGroups =
{
[“DoorGroup1”] = true, – Can be opened,
[“DoorGroup2”] = false, – Can not be opened.
}

local ENT = FindMetaTable(“Entity”)

if ENT.InternalFire == nil then

ENT.InternalFire = ENT.Fire

-- Override Entity.Fire, this is used to open and close doors.
function ENT:Fire(input, param, delay) 

	-- param = param or ""
	-- delay = delay or 0
	
	local actualInput = input:lower()
	if actualInput == "open" then
	
		if self.DoorGroup then
			local allowedToOpen = DoorGroups[self.DoorGroup]
			if allowedToOpen == nil or allowedToOpen == true then
				
				self:InternalFire(input, param, delay)
				
			else
				-- Not allowed, do nothing.
			end
		else
			-- Default
			self:InternalFire(input, param, delay)
		end
	else
		-- Default
		self:InternalFire(input, param, delay)
	end
end

end

– Marking door with the group
Entity(x).DoorGroup = “DoorGroup1” – Allowed to be opened
[/lua]

NOTE: This code is not tested at all this is just an illustration, you would need to also handle Entity.Input

[editline]7th August 2015[/editline]

What the fuck is wrong with Cloudflare, breaking posting.