local objects = 
{
	--Maxime
	createObject(3942,314.3994141,-101.3994141,1000.9000244,0.0000000,0.0000000,0.0000000,10), --object(bistrobar,10), (1,10),
	createObject(1536,323.2999878,-94.9000015,996.9000244,0.0000000,0.0000000,270.0000000,10), --object(gen_doorext15,10), (1,10),
	createObject(1536,323.3349915,-97.9000015,996.9000244,0.0000000,0.0000000,90.0000000,10), --object(gen_doorext15,10), (2,10),
	createObject(5426,336.3994141,-131.5996094,998.5000000,0.0000000,214.9914551,270.0000000,10), --object(laejeffers06,10), (1,10),
	createObject(2188,312.1992188,-92.5996094,997.9000244,0.0000000,0.0000000,0.0000000,10), --object(blck_jack,10), (1,10),
	createObject(2188,319.7998047,-92.5996094,997.9000244,0.0000000,0.0000000,0.0000000,10), --object(blck_jack,10), (2,10),
	createObject(1895,315.8999939,-92.5699997,999.0800171,0.0000000,0.0000000,0.0000000,10), --object(wheel_o_fortune,10), (1,10),
	createObject(1897,315.8999939,-92.4000015,998.0000000,0.0000000,0.0000000,0.0000000,10), --object(wheel_support,10), (1,10),
	createObject(5426,336.3999939,-129.4900055,989.4400024,0.0000000,232.9969482,270.0000000,10), --object(laejeffers06,10), (2,10),
	createObject(1978,315.8994141,-97.1992188,998.0000000,0.0000000,0.0000000,270.0000000,10), --object(roulette_tbl,10), (1,10),
	createObject(1979,317.2500000,-97.0000000,998.0000000,0.0000000,0.0000000,0.0000000,10), --object(wheel_wee,10), (1,10),
	createObject(3942,302.0000000,-114.8496094,996.7999878,0.0000000,0.0000000,270.0000000,10), --object(bistrobar,10), (7,10),
	createObject(2783,304.5000000,-92.5000000,998.4699707,0.0000000,0.0000000,0.0000000,10), --object(cj_bandit_6,10), (1,10),
	createObject(18009,297.5996094,-125.3896484,970.0000000,0.0000000,0.0000000,0.0000000,10), --object(int_rest_main,10), (2,10),
	createObject(16151,305.0898438,-91.7998047,997.2999878,0.0000000,0.0000000,90.0000000,10), --object(ufo_bar,10), (1,10),
	createObject(18009,297.8994141,-138.0498047,970.0000000,0.0000000,0.0000000,0.0000000,10), --object(int_rest_main,10), (3,10),
	createObject(18009,293.0000000,-112.1992188,970.0000000,0.0000000,0.0000000,179.9945068,10), --object(int_rest_main,10), (4,10),
	createObject(1536,299.0996094,-128.1992188,966.7000122,0.0000000,0.0000000,0.0000000,10), --object(gen_doorext15,10), (3,10),
	createObject(2205,287.7998047,-125.6992188,966.7999878,0.0000000,0.0000000,344.9981689,10), --object(med_office8_desk_1,10), (1,10),
	createObject(1545,317.8800049,-105.5599976,998.5999756,0.0000000,0.0000000,180.0000000,10), --object(cj_b_optic1,10), (1,10),
	createObject(2964,294.6000061,-124.6999969,966.7999878,0.0000000,0.0000000,0.0000000,10), --object(k_pooltablesm,10), (1,10),
	createObject(2190,288.0000000,-125.5000000,967.7310181,0.0000000,0.0000000,0.0000000,10), --object(pc_1,10), (1,10),
	createObject(1714,288.2000122,-127.3000031,966.7999878,0.0000000,0.0000000,150.0000000,10), --object(kb_swivelchair1,10), (1,10),
	createObject(1715,288.5000000,-124.3000031,966.7999878,0.0000000,0.0000000,0.0000000,10), --object(kb_swivelchair2,10), (1,10),
	createObject(2965,294.1992188,-124.6992188,967.7199707,0.0000000,0.0000000,0.0000000,10), --object(k_pooltriangle01,10), (1,10),
	createObject(3000,294.7000122,-124.5000000,967.7299805,0.0000000,0.0000000,0.0000000,10), --object(k_poolballstp06,10), (1,10),
	createObject(3001,295.2000122,-124.8000031,967.7299805,0.0000000,0.0000000,0.0000000,10), --object(k_poolballstp07,10), (1,10),
	createObject(18077,315.3340149,-98.8994141,997.5000000,0.0000000,0.0000000,269.9945068,10), --object(din_donut_furn,10), (1,10),
	createObject(3102,294.1000061,-125.0000000,967.7299805,0.0000000,0.0000000,0.0000000,10), --object(k_poolballspt04,10), (1,10),
	createObject(1723,303.0499878,-124.1999969,966.7999878,0.0000000,0.0000000,270.0000000,10), --object(mrk_seating1,10), (1,10),
	createObject(1742,303.1000061,-128.0000000,966.7600098,0.0000000,0.0000000,180.0000000,10), --object(med_bookshelf,10), (1,10),
	createObject(2286,295.7000122,-128.1999969,968.9000244,0.0000000,0.0000000,180.0000000,10), --object(frame_5,10), (1,10),
	createObject(2196,289.1000061,-126.4000015,967.7199707,0.0000000,0.0000000,200.0000000,10), --object(work_lamp1,10), (1,10),
	createObject(1892,321.6000061,-96.0999985,996.9000244,0.0000000,0.0000000,90.0000000,10), --object(security_gatsh,10), (1,10),
	createObject(16780,294.0000000,-125.5000000,971.0999756,0.0000000,0.0000000,0.0000000,10), --object(ufo_light03,10), (1,10),
	createObject(4571,296.0000000,-102.5000000,907.0000000,0.0000000,0.0000000,0.0000000,10), --object(stolenbuilds09,10), (1,10),
	createObject(4571,303.6000061,-147.6999969,907.0000000,0.0000000,0.0000000,0.0000000,10), --object(stolenbuilds09,10), (2,10),
	createObject(2280,293.5000000,-127.7099991,968.5000000,0.0000000,0.0000000,180.0000000,10), --object(frame_thick_1,10), (1,10),
	createObject(1962,292.1000061,-128.1999969,969.2000122,0.0000000,0.0000000,0.0000000,10), --object(record1,10), (1,10),
	createObject(1961,292.1000061,-128.1999969,968.5999756,0.0000000,0.0000000,0.0000000,10), --object(record3,10), (1,10),
	createObject(1892,321.6000061,-97.6999969,996.9000244,0.0000000,0.0000000,90.0000000,10), --object(security_gatsh,10), (2,10),
	createObject(1665,289.2999878,-126.3000031,967.7470093,0.0000000,0.0000000,0.0000000,10), --object(propashtray1,10), (1,10),
	createObject(2773,322.3999939,-93.6999969,997.4400024,0.0000000,0.0000000,134.0000000,10), --object(cj_airprt_bar,10), (2,10),
	createObject(2773,322.3999939,-99.0000000,997.4500122,0.0000000,0.0000000,51.7447510,10), --object(cj_airprt_bar,10), (3,10),
	createObject(1536,309.2000122,-105.6999969,996.9000244,0.0000000,0.0000000,0.0000000,10), --object(gen_doorext15,10), (4,10),
	createObject(1723,309.6000061,-99.8000031,996.9000244,0.0000000,0.0000000,90.0000000,10), --object(mrk_seating1,10), (2,10),
	createObject(3942,303.0000000,-112.6992188,1000.9000244,0.0000000,0.0000000,180.2471924,10), --object(bistrobar,10), (9,10),
	createObject(2007,292.2000122,-122.5999985,966.7999878,0.0000000,0.0000000,0.0000000,10), --object(filing_cab_nu01,10), (1,10),
	createObject(631,308.1000061,-111.4000015,1002.2999878,0.0000000,0.0000000,0.0000000,10), --object(veg_palmkb9,10), (1,10),
	createObject(1541,316.0000000,-105.5999985,998.6024170,0.0000000,0.0000000,0.0000000,10), --object(cj_beer_taps_1,10), (1,10),
	createObject(1548,320.1000061,-105.1999969,998.0999756,0.0000000,0.0000000,0.0000000,10), --object(cj_drip_tray,10), (2,10),
	createObject(1541,313.8999939,-105.5999985,998.6000366,0.0000000,0.0000000,0.0000000,10), --object(cj_beer_taps_1,10), (2,10),
	createObject(1486,315.5000000,-105.3000031,998.2000122,0.0000000,0.0000000,0.0000000,10), --object(dyn_beer_1,10), (4,10),
	createObject(1486,315.8999939,-105.0999985,998.2000122,0.0000000,0.0000000,0.0000000,10), --object(dyn_beer_1,10), (5,10),
	createObject(1486,317.0000000,-105.3000031,998.2000122,0.0000000,0.0000000,0.0000000,10), --object(dyn_beer_1,10), (6,10),
	createObject(1486,318.6000061,-105.0000000,998.2000122,0.0000000,0.0000000,0.0000000,10), --object(dyn_beer_1,10), (7,10),
	createObject(1486,313.0000000,-105.0999985,998.2000122,0.0000000,0.0000000,0.0000000,10), --object(dyn_beer_1,10), (8,10),
	createObject(1486,314.5000000,-105.3000031,998.2000122,0.0000000,0.0000000,0.0000000,10), --object(dyn_beer_1,10), (9,10),
	createObject(1488,314.8999939,-105.5899963,998.5999756,0.0000000,0.0000000,180.0000000,10), --object(dyn_spirit_1,10), (1,10),
	createObject(2714,294.0000000,-122.1299973,969.2000122,0.0000000,0.0000000,0.0000000,10), --object(cj_open_sign_2,10), (1,10),
	createObject(1704,295.8999939,-122.5999985,966.7999878,0.0000000,0.0000000,0.0000000,10), --object(kb_chair03,10), (1,10),
	createObject(1736,286.3750000,-125.3000031,969.2000122,0.0000000,0.0000000,90.0000000,10), --object(cj_stags_head,10), (1,10),
	createObject(630,322.7000122,-94.3000031,997.9500122,0.0000000,0.0000000,0.0000000,10), --object(veg_palmkb8,10), (1,10),
	createObject(630,322.7999878,-98.5000000,997.9500122,0.0000000,0.0000000,0.0000000,10), --object(veg_palmkb8,10), (2,10),
	createObject(2179,306.8999939,-92.3000031,1002.5000000,0.0000000,90.0000000,0.0000000,10), --object(casino_light1,10), (1,10),
	createObject(2179,312.1000061,-92.3000031,1002.5000000,0.0000000,90.0000000,180.0000000,10), --object(casino_light1,10), (2,10),
	createObject(2179,315.5000000,-92.3000031,1002.5000000,0.0000000,90.0000000,0.0000000,10), --object(casino_light1,10), (3,10),
	createObject(2179,320.7000122,-92.3000031,1002.5000000,0.0000000,90.0000000,179.9945068,10), --object(casino_light1,10), (4,10),
	createObject(9911,308.8999939,-108.8000031,994.7910156,0.0000000,180.0000000,8.0000000,10), --object(fishwarf06,10), (1,10),
	createObject(2179,324.1109924,-92.3000031,1002.5000000,0.0000000,90.0000000,0.0000000,10), --object(casino_light1,10), (5,10),

}

local col = createColSphere(322.75504, -96.3672, 997.93127 , 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 )
	--setElementCollisionsEnabled ( object, true )
end


