DOORMODEL2 = "models/props_wasteland/interior_fence003d.mdl"
DOORMODEL1 = "models/props_wasteland/interior_fence003e.mdl"
DOORPRICE=300
_EntPrecacheModel(DOORMODEL1)
_EntPrecacheModel(DOORMODEL2)

function CreateDoor(userid)
	PlayerLookTrace(userid, 300)
	local prop = _EntCreate("prop_physics")
	if prop > 0 then
		_EntSetKeyValue(prop, "model", DOORMODEL1)
		_EntSetPos(prop, vecAdd(_TraceEndPos(), vector3(0,0,72)))
		_EntSpawn(prop)
		_EntSetName(prop, "unfrozenprop")
		_EntSetMaterial(prop, "gmod/wireframe")
		local n = _PlayerInfo(userid, "team")
		PhysProps[prop] = {}
		PhysProps[prop].Owner = userid
		PhysProps[prop].Team = n
		teams[n].props = teams[n].props+1
		_EntFire(prop, "color", teams[n].color.r.." "..teams[n].color.g.." "..teams[n].color.b, 0)
	end
end
