local objects = 
{
	--Maxime
	createObject(7024,1481.5999800,1598.0999800,14.2000000,0.0000000,0.0000000,270.0000000,0), --object(vegasplant069,0), (1,0),
	createObject(8417,1526.1999500,1595.6899400,32.2000000,320.0000000,0.0000000,90.0000000,0), --object(bballcourt01_lvs,0), (2,0),
	createObject(8417,1543.0000000,1595.6899400,33.0000000,319.9990000,0.0000000,90.0000000,0), --object(bballcourt01_lvs,0), (3,0),
	createObject(8417,1555.9000200,1595.6999500,33.0000000,320.0000000,0.0000000,90.0000000,0), --object(bballcourt01_lvs,0), (4,0),
	createObject(8417,1541.3000500,1595.6999500,31.9000000,40.0010000,0.0000000,90.0000000,0), --object(bballcourt01_lvs,0), (5,0),
	createObject(8417,1525.3000500,1595.6899400,33.0000000,40.0010000,0.0000000,90.0000000,0), --object(bballcourt01_lvs,0), (6,0),
	createObject(8417,1512.4000200,1595.6899400,33.0000000,39.9960000,0.0000000,90.0000000,0), --object(bballcourt01_lvs,0), (7,0),
	createObject(7024,1512.8000500,1557.8000500,14.2000000,0.0000000,0.0000000,180.0000000,0), --object(vegasplant069,0), (2,0),
	createObject(11102,1543.0999800,1575.3000500,12.0000000,0.0000000,0.0000000,269.4400000,0), --object(burgalrydoor_sfs,0), (1,0),
	createObject(7024,1540.1999500,1646.6999500,14.2000000,0.0000000,0.0000000,180.0000000,0), --object(vegasplant069,0), (3,0),
	createObject(7024,1585.5999800,1623.0000000,14.2000000,0.0000000,0.0000000,90.0000000,0), --object(vegasplant069,0), (4,0),
	createObject(11102,1526.0000000,1575.3000500,12.0000000,0.0000000,0.0000000,269.4400000,0), --object(burgalrydoor_sfs,0), (2,0),
	createObject(11102,1527.5999800,1616.5000000,16.1000000,0.0000000,0.0000000,90.0000000,0), --object(burgalrydoor_sfs,0), (3,0),
	createObject(11102,1534.0000000,1616.5000000,16.1000000,0.0000000,0.0000000,90.0000000,0), --object(burgalrydoor_sfs,0), (4,0),
	createObject(11102,1540.5000000,1616.5000000,16.1000000,0.0000000,0.0000000,90.0000000,0), --object(burgalrydoor_sfs,0), (5,0),
	createObject(8417,1499.9000200,1627.8000500,14.4000000,0.0000000,180.0000000,180.0000000,0), --object(bballcourt01_lvs,0), (8,0),
	createObject(8417,1569.5500500,1609.0990000,14.4000000,0.0000000,180.0000000,0.0000000,0), --object(bballcourt01_lvs,0), (9,0),
	createObject(8417,1525.0000000,1607.9000200,-6.2500000,0.0000000,90.0000000,90.0000000,0), --object(bballcourt01_lvs,0), (10,0),
	createObject(8417,1541.1999500,1627.8000500,14.4000000,0.0000000,179.9950000,0.0000000,0), --object(bballcourt01_lvs,0), (11,0),
	createObject(8417,1511.8199500,1595.0000000,-6.8000000,0.0000000,90.0000000,180.0000000,0), --object(bballcourt01_lvs,0), (12,0),
	createObject(8417,1555.3900100,1588.3000500,-6.8000000,0.0000000,90.0000000,0.0000000,0), --object(bballcourt01_lvs,0), (13,0),
	createObject(8417,1531.3000500,1575.3000500,-6.1000000,90.0000000,180.0000000,180.0000000,0), --object(bballcourt01_lvs,0), (14,0),
	createObject(8417,1572.5000000,1575.4000200,-6.1000000,90.0000000,179.9950000,179.9950000,0), --object(bballcourt01_lvs,0), (15,0),
	createObject(2917,1534.1999500,1584.8000500,23.4000000,0.0000000,0.0000000,0.0000000,0), --object(a51_crane,0), (1,0),
	createObject(1377,1533.9000200,1563.5000000,22.9000000,0.0000000,0.0000000,0.0000000,0), --object(containercrane_01,0), (1,0),
	createObject(16337,1535.0000000,1575.3000500,10.0000000,0.0000000,0.0000000,270.0000000,0), --object(des_cranecontrol,0), (1,0),
	createObject(2935,1548.0999800,1578.9000200,11.3000000,0.0000000,0.0000000,0.0000000,0), --object(kmb_container_yel,0), (1,0),
	createObject(2932,1551.6999500,1584.0999800,11.3000000,0.0000000,0.0000000,270.0000000,0), --object(kmb_container_blue,0), (1,0),
	createObject(2934,1549.9000200,1578.9000200,14.2000000,0.0000000,0.0000000,0.0000000,0), --object(kmb_container_red,0), (2,0),
	createObject(2935,1553.0000000,1579.5000000,14.2000000,0.0000000,0.0000000,0.0000000,0), --object(kmb_container_yel,0), (4,0),
	createObject(2934,1553.6999500,1578.9000200,11.3000000,0.0000000,0.0000000,0.0000000,0), --object(kmb_container_red,0), (1,0),
	createObject(18260,1518.5999800,1614.6999500,16.0000000,0.0000000,0.0000000,180.0000000,0), --object(crates01,0), (1,0),
	createObject(2062,1518.3000500,1613.6999500,15.0000000,0.0000000,0.0000000,212.3000000,0), --object(cj_oildrum2,0), (2,0),
	createObject(2062,1516.1999500,1615.3000500,15.0000000,0.0000000,0.0000000,212.3000000,0), --object(cj_oildrum2,0), (3,0),
	createObject(2062,1517.3000500,1613.5999800,15.0000000,0.0000000,0.0000000,212.3000000,0), --object(cj_oildrum2,0), (4,0),
	createObject(4106,1553.4000200,1586.5999800,16.8000000,0.0000000,0.0000000,180.0000000,0), --object(shpfireesc_lan,0), (1,0),
	createObject(2567,1514.9000200,1582.5000000,11.7000000,0.0000000,0.0000000,0.0000000,0), --object(ab_warehouseshelf,0), (1,0),
	createObject(2567,1513.0000000,1578.5999800,11.7000000,0.0000000,0.0000000,270.2980000,0), --object(ab_warehouseshelf,0), (2,0),
	createObject(2567,1514.9000200,1582.5000000,15.5000000,0.0000000,0.0000000,0.0000000,0), --object(ab_warehouseshelf,0), (3,0),
	createObject(1437,1514.1999500,1584.3000500,9.8000000,0.0000000,0.0000000,180.0000000,0), --object(dyn_ladder_2,0), (1,0),
	createObject(1558,1513.5999800,1611.0000000,15.0000000,0.0000000,0.0000000,320.0000000,0), --object(cj_cardbrd_pickup,0), (6,0),
	createObject(1558,1516.3000500,1612.5999800,15.0000000,0.0000000,0.0000000,279.9990000,0), --object(cj_cardbrd_pickup,0), (7,0),
	createObject(1462,1554.1999500,1616.0000000,14.4000000,0.0000000,0.0000000,310.0000000,0), --object(dyn_woodpile,0), (1,0),
	createObject(2971,1553.0999800,1613.5000000,14.4000000,0.0000000,0.0000000,0.0000000,0), --object(k_smashboxes,0), (1,0),
	createObject(2971,1515.4000200,1576.9000200,9.8000000,0.0000000,0.0000000,0.0000000,0), --object(k_smashboxes,0), (2,0),
	createObject(3785,1555.2900400,1577.5999800,19.3000000,0.0000000,0.0000000,180.0000000,0), --object(bulkheadlight,0), (1,0),
	createObject(3785,1555.2900400,1589.3000500,19.3000000,0.0000000,0.0000000,180.0000000,0), --object(bulkheadlight,0), (2,0),
	createObject(3785,1555.2900400,1611.5999800,19.3000000,0.0000000,0.0000000,179.9950000,0), --object(bulkheadlight,0), (3,0),
	createObject(11295,1521.0999800,1603.5000000,14.7000000,0.0000000,0.0000000,268.4900000,0), --object(facttanks_sfse09,0), (1,0),
	createObject(8417,1529.1999500,1593.4000200,-10.4300000,14.0000000,90.0000000,0.0000000,0), --object(bballcourt01_lvs,0), (16,0),
	createObject(996,1512.6999500,1608.0000000,15.2000000,0.0000000,0.0000000,0.0000000,0), --object(lhouse_barrier1,0), (1,0),
	createObject(996,1521.3000500,1608.0000000,15.2000000,0.0000000,0.0000000,0.0000000,0), --object(lhouse_barrier1,0), (2,0),
	createObject(3066,1513.4000200,1591.8000500,10.9000000,0.0000000,0.0000000,0.0000000,0), --object(ammotrn_obj,0), (1,0),
	createObject(8445,1539.1770000,1566.5998500,4.1000000,0.0000000,346.0000000,90.0000000,0), --object(vgseedge13,0), (1,0),
	createObject(8441,1654.6999500,1598.0000000,9.1000000,0.0000000,0.0000000,0.0000000,0), --object(vgseedge16,0), (2,0),
	createObject(8417,1548.9000200,1609.0999800,-6.2400000,0.0000000,90.0000000,0.0000000,0), --object(bballcourt01_lvs,0), (17,0),
	createObject(8417,1568.8700000,1589.1400100,-6.2400000,0.0000000,270.0000000,270.0000000,0), --object(bballcourt01_lvs,0), (18,0),
	createObject(996,1549.0000000,1596.9000200,15.1000000,0.0000000,0.0000000,270.2200000,0), --object(lhouse_barrier1,0), (4,0),
	createObject(996,1549.0000000,1605.6999500,15.1000000,0.0000000,0.0000000,270.2200000,0), --object(lhouse_barrier1,0), (5,0),
	createObject(994,1549.0000000,1589.1999500,14.4000000,0.0000000,0.0000000,0.0000000,0), --object(lhouse_barrier2,0), (1,0),
	createObject(3576,1551.1999500,1604.6999500,15.9000000,0.0000000,0.0000000,180.7810000,0), --object(dockcrates2_la,0), (1,0),
	createObject(3577,1552.5999800,1613.4000200,15.2000000,0.0000000,0.0000000,267.6930000,0), --object(dockcrates1_la,0), (1,0),
	createObject(2669,1553.8000500,1592.0000000,15.8000000,0.0000000,0.0000000,180.0000000,0), --object(cj_chris_crate,0), (1,0),
	createObject(2669,1550.5999800,1592.0000000,15.8000000,0.0000000,0.0000000,179.9950000,0), --object(cj_chris_crate,0), (2,0),
	createObject(1771,1550.0000000,1591.1999500,15.2000000,0.0000000,0.0000000,0.0000000,0), --object(cj_bunk_bed1,0), (1,0),
	createObject(1771,1553.1999500,1591.4000200,15.2000000,0.0000000,0.0000000,0.0000000,0), --object(cj_bunk_bed1,0), (2,0),
	createObject(2514,1551.4000200,1589.9000200,14.6000000,0.0000000,0.0000000,180.0000000,0), --object(cj_toilet1,0), (1,0),
	createObject(2514,1554.5999800,1589.9000200,14.6000000,0.0000000,0.0000000,179.9950000,0), --object(cj_toilet1,0), (2,0),
	createObject(2524,1549.6999500,1593.5999800,14.6000000,0.0000000,0.0000000,90.0000000,0), --object(cj_b_sink4,0), (1,0),
	createObject(2524,1552.9000200,1593.8000500,14.6000000,0.0000000,0.0000000,90.0000000,0), --object(cj_b_sink4,0), (2,0),
	createObject(1679,1550.6999500,1601.0000000,14.9000000,0.0000000,0.0000000,0.0000000,0), --object(chairsntableml,0), (1,0),
}

local col = createColSphere(1527.72265625, 1616.08203125, 15.43788433075 , 100)

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 )
	setElementCollisionsEnabled ( object, true )
end


