local objects = 
{
	--Maxime
	createObject(14588,-28.1992200,-105.2998000,1046.8000500,0.0000000,0.0000000,0.0000000,18), --object(ab_abbatoir01,18), (1,18),
	createObject(2109,-18.0000000,-144.8000000,1043.3000500,0.0000000,0.0000000,0.0000000,18), --object(low_dinning_3,18), (1,18),
	createObject(1720,-18.0000000,-143.8000000,1042.9000200,0.0000000,0.0000000,0.0000000,18), --object(rest_chair,18), (1,18),
	createObject(1720,-17.1000000,-145.1000100,1042.9000200,0.0000000,0.0000000,248.0000000,18), --object(rest_chair,18), (2,18),
	createObject(1720,-18.9000000,-145.2000000,1042.9000200,0.0000000,0.0000000,114.0000000,18), --object(rest_chair,18), (3,18),
	createObject(1720,-18.0000000,-145.7000000,1042.9000200,0.0000000,0.0000000,180.0000000,18), --object(rest_chair,18), (4,18),
	createObject(2290,-13.6992200,-143.0996100,1042.9000200,0.0000000,0.0000000,270.0000000,18), --object(swk_couch_1,18), (1,18),
	createObject(2286,-15.1000000,-139.3999900,1045.1999500,0.0000000,0.0000000,0.0000000,18), --object(frame_5,18), (1,18),
	createObject(2262,-13.7000000,-140.8000000,1045.0999800,0.0000000,0.0000000,270.0000000,18), --object(frame_slim_3,18), (1,18),
	createObject(1822,-14.2000000,-146.7000000,1042.9000200,0.0000000,0.0000000,0.0000000,18), --object(coffee_swank_6,18), (1,18),
	createObject(2066,-13.5996100,-139.7998000,1042.9000200,0.0000000,0.0000000,0.0000000,18), --object(cj_m_fileing2,18), (2,18),
	createObject(2164,-19.7998000,-142.0996100,1042.9000200,0.0000000,0.0000000,90.0000000,18), --object(med_office_unit_5,18), (1,18),
	createObject(2811,-19.5000000,-140.1000100,1042.9000200,0.0000000,0.0000000,0.0000000,18), --object(gb_romanpot01,18), (1,18),
	createObject(2247,-13.7000000,-146.2000000,1043.9000200,0.0000000,0.0000000,0.0000000,18), --object(plant_pot_15,18), (1,18),
	createObject(1455,-13.7000000,-146.0000000,1043.5000000,0.0000000,0.0000000,0.0000000,18), --object(dyn_glass,18), (2,18),
	createObject(1455,-13.9000000,-145.8999900,1043.5000000,0.0000000,0.0000000,0.0000000,18), --object(dyn_glass,18), (3,18),
	createObject(1665,-13.9000000,-146.2000000,1043.5000000,0.0000000,0.0000000,0.0000000,18), --object(propashtray1,18), (1,18),
	createObject(1487,-13.5000000,-145.8999900,1043.5999800,0.0000000,0.0000000,0.0000000,18), --object(dyn_wine_1,18), (1,18),
	createObject(1665,-17.9000000,-144.6000100,1043.7600100,0.0000000,0.0000000,0.0000000,18), --object(propashtray1,18), (2,18),
	createObject(1921,-18.1000000,-144.6000100,1043.6999500,0.0000000,0.0000000,0.0000000,18), --object(chip_stack12,18), (2,18),
	createObject(1921,-18.0000000,-144.7000000,1043.6999500,0.0000000,0.0000000,0.0000000,18), --object(chip_stack12,18), (3,18),
	createObject(1721,-16.1000000,-139.8000000,1042.9000200,0.0000000,0.0000000,235.0000000,18), --object(est_chair1,18), (1,18),
	createObject(1721,-16.0000000,-141.2000000,1042.9000200,0.0000000,0.0000000,315.0000000,18), --object(est_chair1,18), (2,18),
	createObject(1721,-13.9000000,-140.6000100,1042.9000200,0.0000000,0.0000000,81.9910000,18), --object(est_chair1,18), (3,18),
	createObject(1930,-18.1000000,-144.7000000,1043.6999500,0.0000000,0.0000000,0.0000000,18), --object(chip_stack13,18), (4,18),
	createObject(1930,-18.1000000,-144.8000000,1043.6999500,0.0000000,0.0000000,0.0000000,18), --object(chip_stack13,18), (5,18),
	createObject(1931,-18.0000000,-144.8000000,1043.6999500,0.0000000,0.0000000,0.0000000,18), --object(chip_stack14,18), (1,18),
	createObject(1736,-16.6000000,-146.5000000,1045.5000000,0.0000000,0.0000000,180.0000000,18), --object(cj_stags_head,18), (1,18),
	createObject(1717,-14.5000000,-146.1000100,1042.9000200,0.0000000,0.0000000,128.0000000,18), --object(telly_low_test,18), (1,18),
	createObject(2276,-19.3000000,-144.8999900,1044.9000200,0.0000000,0.0000000,90.0000000,18), --object(frame_fab_3,18), (1,18),
	createObject(2256,-13.2000000,-143.6000100,1045.4000200,0.0000000,0.0000000,270.0000000,18), --object(frame_clip_3,18), (1,18),
	createObject(1498,-19.0250000,-139.3000000,1042.9000200,0.0000000,0.0000000,0.0000000,18), --object(gen_doorext03,18), (1,18),
	createObject(1720,-17.1000000,-144.3000000,1042.9000200,0.0000000,0.0000000,294.0000000,18), --object(rest_chair,18), (6,18),
	createObject(1720,-18.9000000,-144.3999900,1042.9000200,0.0000000,0.0000000,70.0000000,18), --object(rest_chair,18), (7,18),
	createObject(2258,-19.8000000,-141.7000000,1045.5000000,0.0000000,0.0000000,90.0000000,18), --object(frame_clip_5,18), (1,18),
	createObject(2247,-14.9000000,-139.7000000,1044.1999500,0.0000000,0.0000000,0.0000000,18), --object(plant_pot_15,18), (2,18),
	createObject(16780,-16.5000000,-143.3999900,1046.6999500,0.0000000,0.0000000,0.0000000,18), --object(ufo_light03,18), (1,18),
	createObject(2173,-14.8000000,-140.8999900,1042.9000200,0.0000000,0.0000000,90.0000000,18), --object(med_office_desk_3,18), (1,18),
}

local col = createColSphere( -18.2, -139.89999, 1043.90002, 20)

local function watchChanges( )
	if getElementDimension( getLocalPlayer( ) ) > 0 and getElementDimension( getLocalPlayer( ) ) ~= getElementDimension( objects[1] ) and getElementInterior( getLocalPlayer( ) ) == getElementInterior( objects[1] ) then
		for key, value in pairs( objects ) do
			setElementDimension( value, getElementDimension( getLocalPlayer( ) ) )
		end
	elseif getElementDimension( getLocalPlayer( ) ) == 0 and getElementDimension( objects[1] ) ~= 65535 then
		for key, value in pairs( objects ) do
			setElementDimension( value, 65535 )
		end
	end
end
addEventHandler( "onClientColShapeHit", col,
	function( element )
		if element == getLocalPlayer( ) then
			addEventHandler( "onClientRender", root, watchChanges )
		end
	end
)
addEventHandler( "onClientColShapeLeave", col,
	function( element )
		if element == getLocalPlayer( ) then
			removeEventHandler( "onClientRender", root, watchChanges )
		end
	end
)

-- Put them standby for now.
for key, value in pairs( objects ) do
	setElementDimension( value, 65535 )
end


for index, object in ipairs ( objects ) do
    setElementDoubleSided ( object, true )
	-- if getElementModel(object) == 10281 then
		-- setObjectScale ( object, 0.60000002384186  )
	-- end
	setElementCollisionsEnabled ( object, true )
end




