local objects = 
{
	--Maxime
	
	createObject(14506,2239.6999500,-1165.0999800,1038.0000000,0.0000000,0.0000000,0.0000000,46), --object(imy_motel_int,46), (1,46),
	createObject(14846,1473.3994100,1752.2998000,14.8000000,0.0000000,0.0000000,0.0000000,46), --object(int_ppol,46), (2,46),
	createObject(1535,1470.4000200,1752.5000000,13.7000000,0.0000000,0.0000000,0.0000000,46), --object(gen_doorext14,46), (1,46),
	createObject(1535,1473.4000200,1752.5365000,13.7000000,0.0000000,0.0000000,179.9950000,46), --object(gen_doorext14,46), (2,46),
	createObject(8167,1466.1999500,1759.0999800,16.3000000,0.0000000,0.0000000,0.0000000,46), --object(apgate1_vegs01,46), (2,46),
	createObject(1535,1467.0000000,1768.3000500,13.7000000,0.0000000,0.0000000,0.0000000,46), --object(gen_doorext14,46), (1,46),
	createObject(1535,1468.5000000,1768.3000500,13.7000000,0.0000000,0.0000000,0.0000000,46), --object(gen_doorext14,46), (1,46),
	createObject(1535,1471.0000000,1768.2998000,13.7000000,0.0000000,0.0000000,0.0000000,46), --object(gen_doorext14,46), (1,46),
	createObject(1535,1472.5000000,1768.3000500,13.7000000,0.0000000,0.0000000,0.0000000,46), --object(gen_doorext14,46), (1,46),
	createObject(1776,1469.7998000,1767.5000000,14.9000000,0.0000000,0.0000000,0.0000000,46), --object(cj_candyvendor,46), (1,46),
	createObject(2838,1475.0000000,1765.1992200,14.6600000,0.0000000,0.0000000,0.0000000,46), --object(gb_takeaway03,46), (1,46),
	createObject(2370,1474.6999500,1765.0999800,13.8000000,0.0000000,0.0000000,359.5800000,46), --object(shop_set_1_table,46), (1,46),
	createObject(1712,1478.0999800,1766.3000500,13.8000000,0.0000000,0.0000000,265.3960000,46), --object(kb_couch05,46), (1,46),
	createObject(1710,1473.3000500,1767.4000200,13.8000000,0.0000000,0.0000000,0.0000000,46), --object(kb_couch07,46), (1,46),
	createObject(1512,1476.8000500,1764.0999800,14.0000000,0.0000000,0.0000000,0.0000000,46), --object(dyn_wine_03,46), (1,46),
	createObject(1512,1477.1999500,1767.3000500,14.4000000,0.0180000,89.7800000,268.3430000,46), --object(dyn_wine_03,46), (2,46),
	createObject(1512,1477.0999800,1767.3000500,14.3350000,90.0000000,92.0480000,271.4760000,46), --object(dyn_wine_03,46), (3,46),
	createObject(14527,1472.1992200,1760.0996100,14.6000000,0.0000000,0.0000000,0.0000000,46), --object(fannyfan,46), (1,46),
	createObject(2395,1466.4000200,1758.0999800,13.8000000,0.0000000,0.0000000,90.0000000,46), --object(cj_sports_wall,46), (3,46),
	createObject(2395,1466.3994100,1763.8994100,13.8000000,0.0000000,0.0000000,90.0000000,46), --object(cj_sports_wall,46), (4,46),
	createObject(1778,1478.0000000,1753.5999800,13.8000000,0.0000000,0.0000000,170.0000000,46), --object(cj_mop_pail,46), (1,46),
	createObject(1209,1466.6999500,1757.6999500,13.8000000,0.0000000,0.0000000,90.0000000,46), --object(vendmach,46), (1,46),
	createObject(14520,1471.0000000,1759.5000000,14.1000000,0.0000000,0.0000000,217.2740000,46), --object(immy_clothes,46), (1,46),
	createObject(2953,1476.3000500,1765.5000000,13.8000000,0.0000000,0.0000000,102.3020000,46), --object(kmb_paper_code,46), (1,46),
	createObject(2953,1470.5999800,1757.9000200,13.8000000,0.0000000,0.0000000,92.2990000,46), --object(kmb_paper_code,46), (2,46),
	createObject(2953,1466.4000200,1762.5000000,15.0000000,0.0000000,0.0000000,92.2960000,46), --object(kmb_paper_code,46), (3,46),
	createObject(2690,1467.1999500,1753.1999500,14.1000000,0.0000000,0.0000000,190.0000000,46), --object(cj_fire_ext,46), (1,46),
	createObject(2690,1467.5999800,1753.1999500,14.1000000,0.0000000,0.0000000,189.9980000,46), --object(cj_fire_ext,46), (2,46),
	createObject(14819,1466.5300300,1765.3000500,14.9000000,0.0000000,0.0000000,270.0000000,46), --object(og_door,46), (1,46),
	createObject(2110,1467.1999500,1755.9000200,13.8000000,0.0000000,0.0000000,270.0000000,46), --object(low_dinning_4,46), (1,46),
	createObject(2108,1478.0000000,1767.0999800,13.8000000,0.0000000,0.0000000,0.0000000,46), --object(cj_mlight13,46), (1,46),
	createObject(1810,1467.8000500,1754.5000000,13.8000000,0.0000000,0.0000000,245.3960000,46), --object(cj_foldchair,46), (1,46),
	createObject(1810,1468.0000000,1755.5000000,13.8000000,0.0000000,0.0000000,295.3910000,46), --object(cj_foldchair,46), (2,46),
	createObject(2894,1467.4000200,1755.0000000,14.6000000,0.0000000,0.0000000,270.0000000,46), --object(kmb_rhymesbook,46), (1,46),
	createObject(2670,1473.8000500,1765.3000500,13.9000000,0.0000000,2.3020000,98.7470000,46), --object(proc_rubbish_1,46), (1,46),
	createObject(1265,1477.5999800,1753.4000200,14.2000000,0.0000000,0.0000000,0.0000000,46), --object(blackbag2,46), (1,46),
	createObject(1535,1478.6999500,1761.0999800,13.7000000,0.0000000,0.0000000,270.0000000,46), --object(gen_doorext14,46), (1,46),
	createObject(1535,1478.6999500,1755.4000200,13.7000000,0.0000000,0.0000000,270.0000000,46), --object(gen_doorext14,46), (1,46),
	createObject(1535,1478.6999500,1758.1999500,13.7000000,0.0000000,0.0000000,270.0000000,46), --object(gen_doorext14,46), (1,46),
	createObject(1535,1478.6999500,1763.9000200,13.7000000,0.0000000,0.0000000,270.0000000,46), --object(gen_doorext14,46), (1,46),


}

local col = createColSphere( 1471.8935546875, 1752.9169921875, 14.760937690735, 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




