local objects = 
{
	--Maxime
	createObject(18024,877.2999878,164.6000061,1011.5000000,0.0000000,0.0000000,0.0000000,41), --object(int_clothe_ship,41), (1,41),
	createObject(1967,854.2999878,154.1000061,1009.5999756,0.0000000,0.0000000,90.0000000,41), --object(imcmptrkdrr_las,41), (1,41),
	createObject(18024,857.3994141,163.8994141,1011.2999878,0.0000000,0.0000000,0.0000000,41), --object(int_clothe_ship,41), (2,41),
	createObject(5779,860.0000000,154.0000000,1009.9000244,0.0000000,0.0000000,90.0000000,41), --object(garagdoor1_lawn,41), (1,41),
	createObject(5779,850.0999756,154.0000000,1009.9000244,0.0000000,0.0000000,90.0000000,41), --object(garagdoor1_lawn,41), (2,41),
	createObject(16151,861.5996094,168.5996094,1008.4920044,0.0000000,0.0000000,0.0000000,41), --object(ufo_bar,41), (1,41),
	createObject(2188,848.9000244,155.6000061,1009.0999756,0.0000000,0.0000000,135.0000000,41), --object(blck_jack,41), (3,41),
	createObject(2289,854.5000000,172.6999969,1011.0700073,0.0000000,0.0000000,0.0000000,41), --object(frame_2,41), (1,41),
	createObject(2287,858.0999756,172.3000031,1010.7069702,0.0000000,0.0000000,0.0000000,41), --object(frame_4,41), (1,41),
	createObject(2284,849.5999756,172.0000000,1010.6707153,0.0000000,0.0000000,0.0000000,41), --object(frame_6,41), (1,41),
	createObject(1723,847.8994141,159.8000031,1008.2000122,0.0000000,0.0000000,90.0000000,41), --object(mrk_seating1,41), (1,41),
	createObject(1824,850.2000122,170.1999969,1009.2000122,0.0000000,0.0000000,0.0000000,41), --object(craps_table,41), (1,41),
	createObject(2026,855.0100098,155.1999969,1012.1697998,0.0000000,0.0000000,0.0000000,41), --object(mrk_shade_tmp,41), (1,41),
	createObject(2026,855.0097656,170.1992188,1012.1697998,0.0000000,0.0000000,0.0000000,41), --object(mrk_shade_tmp,41), (2,41),
	createObject(2026,855.0097656,167.1992188,1012.1697998,0.0000000,0.0000000,0.0000000,41), --object(mrk_shade_tmp,41), (3,41),
	createObject(2026,855.0097656,163.1992188,1012.1697998,0.0000000,0.0000000,0.0000000,41), --object(mrk_shade_tmp,41), (4,41),
	createObject(2026,855.0097656,159.1992188,1012.1697998,0.0000000,0.0000000,0.0000000,41), --object(mrk_shade_tmp,41), (5,41),
	createObject(1723,853.5000000,169.1999969,1008.2000122,0.0000000,0.0000000,90.0000000,41), --object(mrk_seating1,41), (2,41),
	createObject(1723,854.4000244,172.1699982,1008.2000122,0.0000000,0.0000000,0.0000000,41), --object(mrk_seating1,41), (3,41),
	createObject(1724,851.8994141,167.3099976,1008.2000122,0.0000000,0.0000000,0.0000000,41), --object(mrk_seating1b,41), (2,41),
	createObject(1724,857.7000122,172.1699982,1008.2000122,0.0000000,0.0000000,0.0000000,41), --object(mrk_seating1b,41), (3,41),
	createObject(1724,848.4000244,167.3099976,1008.2000122,0.0000000,0.0000000,0.0000000,41), --object(mrk_seating1b,41), (4,41),
	createObject(1723,847.8994141,164.0996094,1008.2000122,0.0000000,0.0000000,90.0000000,41), --object(mrk_seating1,41), (4,41),
	createObject(2188,860.8994141,156.0996094,1009.0999756,0.0000000,0.0000000,225.0000000,41), --object(blck_jack,41), (1,41),
	createObject(2188,864.6992188,159.8999939,1009.4000244,0.0000000,0.0000000,90.0000000,41), --object(blck_jack,41), (1,41),
	createObject(646,853.2999878,172.3000031,1009.5999756,0.0000000,0.0000000,0.0000000,41), --object(veg_palmkb14,41), (1,41),
	createObject(646,847.7998047,167.1992188,1009.5999756,0.0000000,0.0000000,0.0000000,41), --object(veg_palmkb14,41), (2,41),
	createObject(646,857.2000122,172.3999939,1009.5999756,0.0000000,0.0000000,0.0000000,41), --object(veg_palmkb14,41), (3,41),
	createObject(1892,854.5000000,155.3000031,1008.2000122,0.0000000,0.0000000,0.0000000,41), --object(security_gatsh,41), (1,41),
	createObject(14749,848.5996094,172.8994141,1010.7999878,0.0000000,0.0000000,269.9945068,41), --object(sfhsm1lights,41), (2,41),
	createObject(1822,847.5000000,162.3999939,1008.2000122,0.0000000,0.0000000,0.0000000,41), --object(coffee_swank_6,41), (1,41),
	createObject(646,847.7999878,159.0000000,1009.5999756,0.0000000,0.0000000,0.0000000,41), --object(veg_palmkb14,41), (4,41),
	createObject(1723,862.1580200,161.0000000,1008.2000122,0.0000000,0.0000000,270.0000000,41), --object(mrk_seating1,41), (5,41),
	createObject(646,862.0000000,158.1000061,1009.5999756,0.0000000,0.0000000,0.0000000,41), --object(veg_palmkb14,41), (6,41),
	createObject(2606,865.5999756,168.6000061,1010.0999756,0.0000000,0.0000000,0.0000000,41), --object(cj_police_counter2,41), (1,41),
	createObject(2959,865.0996094,165.0996094,1008.4000244,0.0000000,0.0000000,270.0000000,41), --object(rider1_door,41), (1,41),
	createObject(2959,866.5996094,161.5000000,1008.4000244,0.0000000,0.0000000,90.0000000,41), --object(rider1_door,41), (2,41),
	createObject(2640,855.5000000,160.0000000,1009.0000000,0.0000000,0.0000000,90.0000000,41), --object(neil_slot,41), (1,41),
	createObject(2640,854.2999878,160.0500031,1009.0000000,0.0000000,0.0000000,270.0000000,41), --object(neil_slot,41), (2,41),
	createObject(2640,855.5000000,160.8000031,1009.0000000,0.0000000,0.0000000,90.0000000,41), --object(neil_slot,41), (3,41),
	createObject(2640,855.5000000,161.6000061,1009.0000000,0.0000000,0.0000000,90.0000000,41), --object(neil_slot,41), (4,41),
	createObject(2640,855.5000000,162.3999939,1009.0000000,0.0000000,0.0000000,90.0000000,41), --object(neil_slot,41), (5,41),
	createObject(2640,855.5000000,163.1999969,1009.0000000,0.0000000,0.0000000,90.0000000,41), --object(neil_slot,41), (6,41),
	createObject(2640,854.2999878,160.8500061,1009.0000000,0.0000000,0.0000000,269.9945068,41), --object(neil_slot,41), (7,41),
	createObject(2640,854.2999878,161.6499939,1009.0000000,0.0000000,0.0000000,270.0000000,41), --object(neil_slot,41), (8,41),
	createObject(2640,854.2999878,162.4600067,1009.0000000,0.0000000,0.0000000,269.9945068,41), --object(neil_slot,41), (9,41),
	createObject(2640,854.2999878,163.2599945,1009.0000000,0.0000000,0.0000000,269.9945068,41), --object(neil_slot,41), (10,41),
	createObject(1723,850.0000000,161.8000031,1008.2000122,0.0000000,0.0000000,270.0000000,41), --object(mrk_seating1,41), (6,41),
	createObject(1723,850.0000000,166.0996094,1008.2000122,0.0000000,0.0000000,269.9945068,41), --object(mrk_seating1,41), (7,41),
	createObject(1724,860.5999756,162.0000000,1008.2000122,0.0000000,0.0000000,0.0000000,41), --object(mrk_seating1b,41), (5,41),
	createObject(1723,847.8994141,164.0996094,1008.2000122,0.0000000,0.0000000,90.0000000,41), --object(mrk_seating1,41), (8,41),
	createObject(1723,860.0000000,158.8999939,1008.2000122,0.0000000,0.0000000,90.0000000,41), --object(mrk_seating1,41), (9,41),
	createObject(1723,856.5000000,168.1999969,1008.2000122,0.0000000,0.0000000,180.0000000,41), --object(mrk_seating1,41), (10,41),
	createObject(646,853.4000244,168.3999939,1009.5999756,0.0000000,0.0000000,0.0000000,41), --object(veg_palmkb14,41), (7,41),
	createObject(3440,854.9000244,158.5000000,1010.5000000,0.0000000,0.0000000,0.0000000,41), --object(arptpillar01_lvs,41), (1,41),
	createObject(3440,854.9000244,165.1000061,1010.5000000,0.0000000,0.0000000,0.0000000,41), --object(arptpillar01_lvs,41), (2,41),
	createObject(1895,867.2000122,163.3000031,1010.8300171,0.0000000,0.0000000,270.0000000,41), --object(wheel_o_fortune,41), (1,41),
	createObject(2010,866.7000122,164.6000061,1008.3699951,0.0000000,0.0000000,0.0000000,41), --object(nu_plant3_ofc,41), (1,41),
	createObject(2010,866.7000122,162.0200043,1008.3699951,0.0000000,0.0000000,0.0000000,41), --object(nu_plant3_ofc,41), (2,41),


}

local col = createColSphere(855.017578125, 154.5146484375, 1009.151550293, 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




