Respawning Doors

Hello,
I have CS:S Real Weapons on my DarkRP server, and the M3 Super 90, just blows down doors, but the doors wont respawn back after they’ve been shot down. What’s the lua script or code for that, and where would i put/edit the code at in my server files. Be accurate and detailed please!

The shotguns are awesome and i’d like adding that too, but I have the same issue. If someone could help out that’d be great!

On this CSS Real Weapons I have here there is a fine door respawn part in the code, I may have the wrong one. Could you codetag the shotgun’s shared.lua?

How would i find the files for the shotguns shared.lua, im using workshop.vdf, I dont think i can edit the setings. Because i have the correct code for door resapwn i just dont know how i can put it in my files.

so whats the fix? i still dont know how to make the doors respawn :confused:

I believe it has something to do with DarkRP.

shotguns are overpowered as they are.

Where is the door re-spawn speed located at, because on my server the doors do not re-spawn at all.

Well, I at least know there is about a 5 minute respawn on windows in rp_downtown_V2, I remember back in Gmod 12, they respawned in about a minute or so.

There might be something to the way Gmod13 handles doors (Seeing how most of them are darkend).

I could really use this too, if there is no fix available, Can someone at least tell me how to remove the shotguns ability to blow doors down?

[editline]14th February 2013[/editline]

Ok, I found the code that manages how the doors are knocked down and replaces, can’t find anything wrong with it (im a noob coder bwt) but I will post it here for others to view.



 	local trace = self.Owner:GetEyeTrace();

	if trace.HitPos:Distance(self.Owner:GetShootPos()) > 250 or self.DestroyDoor == 0 then return end

	if trace.Entity:GetClass() == "prop_door_rotating" and self.mode == "burst" and (SERVER) then

		if !IsValid(self.Owner) then return end

		trace.Entity:Fire("open", "", 0.001)
		trace.Entity:Fire("unlock", "", 0.001)

		local pos = trace.Entity:GetPos()
		local ang = trace.Entity:GetAngles()
		local model = trace.Entity:GetModel()
		local skin = trace.Entity:GetSkin()

		local smoke = EffectData()
			smoke:SetOrigin(pos)
			util.Effect("effect_smokedoor", smoke)

		trace.Entity:SetNotSolid(true)
		trace.Entity:SetNoDraw(true)

		local function ResetDoor(door, fakedoor)
			if (!door or !IsValid(door)) then return end
			door:SetNotSolid(false)
			door:SetNoDraw(false)
			fakedoor:Remove()
		end

		local norm = (pos - self.Owner:GetPos()):GetNormalized()
		local push = 10000 * norm
		local ent = ents.Create("prop_physics")

		ent:SetPos(pos)
		ent:SetAngles(ang)
		ent:SetModel(model)

		if(skin) then
			ent:SetSkin(skin)
		end

		ent:Spawn()

		timer.Simple(0.01, ent.SetVelocity, ent, push)               
		timer.Simple(0.01, ent:GetPhysicsObject().ApplyForceCenter, ent:GetPhysicsObject(), push)
		timer.Simple(25, ResetDoor, trace.Entity, ent)
	end
end


There is a fix for this. infact i used the blow down doors function from css realistic weapons on my SPAS 12. the thing was broken but i was able to fix it. the problem was some broken timers and such, but here is the fix:



local trace = self.Owner:GetEyeTrace();

	if trace.HitPos:Distance(self.Owner:GetShootPos()) > 250 or self.DestroyDoor == 0 then return end

	if trace.Entity:GetClass() == "prop_door_rotating" and self.mode == "burst" and (SERVER) then

		trace.Entity:Fire("open", "", 0.001)
		trace.Entity:Fire("unlock", "", 0.001)

		local pos = trace.Entity:GetPos()
		local ang = trace.Entity:GetAngles()
		local model = trace.Entity:GetModel()
		local skin = trace.Entity:GetSkin()

		local smoke = EffectData()
			smoke:SetOrigin(pos)
			util.Effect("effect_smokedoor", smoke)

		trace.Entity:SetNotSolid(true)
		trace.Entity:SetNoDraw(true)

		local function ResetDoor(door, fakedoor)
			door:SetNotSolid(false)
			door:SetNoDraw(false)
			fakedoor:Remove()
		end

		local norm = (pos - self.Owner:GetPos())
		norm:Normalize()
		local push = 1000 * norm
		local ent = ents.Create("prop_physics")

		ent:SetPos(pos)
		ent:SetAngles(ang)
		ent:SetModel(model)

		if(skin) then
			ent:SetSkin(skin)
		end

		ent:Spawn()

		timer.Simple(0.01, function() if ent and push then ent:GetPhysicsObject():SetVelocity(push) end end)              
		timer.Simple(0.01, function() if ent and push then ent:GetPhysicsObject():SetVelocity(push) end end)
		timer.Simple(25, function() ResetDoor( trace.Entity, ent, 10) end )
	end
end


If you want to remove the ability to destroy doors, at the top of the shared.lua, there is something like this:




-- CAN THE SHOTGUN DESTROY DOORS WITH THE BUCKSHOT ROUNDS? 1 = YES, 0 = NO
SWEP.DestroyDoor = 1


Hope this helps :wink:

so where exactly do we paste this too, the main.lua

Where do i place this code and what is the file called