local objects = 
{
	--Maxime
	createObject(9054,372.1000100,-284.0000000,1012.0999800,0.0000000,0.0000000,0.0000000,7), --object(chnatwnmll14_lvs,7), (2,7),
	createObject(9054,387.7000100,-255.0000000,1012.0999800,0.0000000,0.0000000,0.0000000,7), --object(chnatwnmll14_lvs,7), (3,7),
	createObject(10378,424.7000100,-307.7999900,1006.2700200,0.0000000,0.0000000,0.0000000,7), --object(ctiyhallsquare_sfs,7), (1,7),
	createObject(9054,438.8999900,-331.2000100,1012.0999800,0.0000000,0.0000000,180.0000000,7), --object(chnatwnmll14_lvs,7), (4,7),
	createObject(1337,397.6000100,-68.2000000,891.5999800,0.0000000,0.0000000,0.0000000,7), --object(binnt07_la,7), (4,7),
	createObject(9054,423.2999900,-343.0000000,1012.0999800,0.0000000,0.0000000,179.9950000,7), --object(chnatwnmll14_lvs,7), (5,7),
	createObject(2436,400.2000100,-295.6000100,1006.2299800,0.0000000,0.0000000,0.0000000,7), --object(cj_ff_disp2,7), (1,7),
	createObject(2433,404.6499900,-295.6000100,1006.2299800,0.0000000,0.0000000,0.0000000,7), --object(cj_ff_disp1,7), (1,7),
	createObject(2436,401.7998000,-295.5996100,1006.2299800,0.0000000,0.0000000,0.0000000,7), --object(cj_ff_disp2,7), (2,7),
	createObject(2433,407.6000100,-294.6000100,1006.2299800,0.0000000,0.0000000,90.0000000,7), --object(cj_ff_disp1,7), (2,7),
	createObject(2435,406.6000100,-295.7000100,1006.2299800,0.0000000,0.0000000,0.0000000,7), --object(cj_ff_conter_2,7), (1,7),
	createObject(2434,407.5300000,-295.7000400,1006.2299800,0.0000000,0.0000000,0.0000000,7), --object(cj_ff_conter_2b,7), (1,7),
	createObject(2443,400.2000100,-293.5000000,1006.2299800,0.0000000,0.0000000,0.0000000,7), --object(cj_ff_frige,7), (2,7),
	createObject(14762,405.2999900,-304.7999900,1008.0000000,0.0000000,0.0000000,90.0000000,7), --object(arsewinows,7), (1,7),
	createObject(1533,404.0000000,-304.7999900,1006.2399900,0.0000000,0.0000000,180.0000000,7), --object(gen_doorext12,7), (1,7),
	createObject(2422,406.7000100,-295.3999900,1007.2650100,0.0000000,0.0000000,0.0000000,7), --object(cj_ff_till,7), (1,7),
	createObject(1720,401.7999900,-301.8999900,1006.2399900,0.0000000,0.0000000,270.0000000,7), --object(rest_chair,7), (1,7),
	createObject(2555,399.7999900,-293.5000000,1006.2299800,0.0000000,0.0000000,0.0000000,7), --object(cj_ss_5_m,7), (1,7),
	createObject(1720,401.7999900,-301.2000100,1006.2399900,0.0000000,0.0000000,270.0000000,7), --object(rest_chair,7), (2,7),
	createObject(2747,401.0000000,-301.5000000,1006.6599700,0.0000000,0.0000000,90.0000000,7), --object(cj_donut_table,7), (1,7),
	createObject(2747,410.0000000,-303.7000100,1006.6599700,0.0000000,0.0000000,90.0000000,7), --object(cj_donut_table,7), (2,7),
	createObject(1720,409.2000100,-304.0000000,1006.2399900,0.0000000,0.0000000,90.0000000,7), --object(rest_chair,7), (3,7),
	createObject(1720,409.2000100,-303.2999900,1006.2399900,0.0000000,0.0000000,90.0000000,7), --object(rest_chair,7), (4,7),
	createObject(1720,400.2000100,-302.0000000,1006.2399900,0.0000000,0.0000000,90.0000000,7), --object(rest_chair,7), (5,7),
	createObject(1720,400.2000100,-301.2000100,1006.2399900,0.0000000,0.0000000,90.0000000,7), --object(rest_chair,7), (6,7),
	createObject(2555,400.7999900,-293.5000000,1006.2299800,0.0000000,0.0000000,0.0000000,7), --object(cj_ss_5_m,7), (2,7),
	createObject(2555,401.7999900,-293.5000000,1006.2299800,0.0000000,0.0000000,0.0000000,7), --object(cj_ss_5_m,7), (3,7),
	createObject(1850,402.3999900,-293.5000000,1005.0100100,0.0000000,0.0000000,0.0000000,7), --object(shop_shelf08,7), (3,7),
	createObject(1720,410.7999900,-303.2999900,1006.2399900,0.0000000,0.0000000,269.9950000,7), --object(rest_chair,7), (7,7),
	createObject(1720,410.7999900,-304.0000000,1006.2399900,0.0000000,0.0000000,269.9950000,7), --object(rest_chair,7), (8,7),
	createObject(1720,410.7999900,-300.2000100,1006.2399900,0.0000000,0.0000000,269.9950000,7), --object(rest_chair,7), (9,7),
	createObject(2432,401.1600000,-292.7000100,1007.5800200,0.0000000,0.0000000,0.0000000,7), --object(cj_ff_list3,7), (1,7),
	createObject(1720,410.7999900,-300.8999900,1006.2399900,0.0000000,0.0000000,269.9950000,7), --object(rest_chair,7), (10,7),
	createObject(2747,410.0000000,-300.5000000,1006.6599700,0.0000000,0.0000000,90.0000000,7), --object(cj_donut_table,7), (3,7),
	createObject(1720,410.7999900,-297.2999900,1006.2399900,0.0000000,0.0000000,270.0000000,7), --object(rest_chair,7), (12,7),
	createObject(1720,409.2000100,-300.8999900,1006.2399900,0.0000000,0.0000000,90.0000000,7), --object(rest_chair,7), (13,7),
	createObject(1720,410.7999900,-298.0000000,1006.2399900,0.0000000,0.0000000,270.0000000,7), --object(rest_chair,7), (14,7),
	createObject(1720,409.2000100,-300.2000100,1006.2399900,0.0000000,0.0000000,90.0000000,7), --object(rest_chair,7), (15,7),
	createObject(2747,410.0000000,-297.6000100,1006.6599700,0.0000000,0.0000000,90.0000000,7), --object(cj_donut_table,7), (4,7),
	createObject(1720,409.2000100,-297.2999900,1006.2399900,0.0000000,0.0000000,90.0000000,7), --object(rest_chair,7), (16,7),
	createObject(1720,409.2000100,-298.0000000,1006.2399900,0.0000000,0.0000000,90.0000000,7), --object(rest_chair,7), (17,7),
	createObject(2635,401.0000000,-299.7000100,1006.6599700,0.0000000,0.0000000,0.0000000,7), --object(cj_pizza_table,7), (2,7),
	createObject(1720,401.7999900,-299.7000100,1006.2399900,0.0000000,0.0000000,269.9950000,7), --object(rest_chair,7), (18,7),
	createObject(1720,400.2000100,-299.7999900,1006.2399900,0.0000000,0.0000000,90.0000000,7), --object(rest_chair,7), (19,7),
	createObject(2414,404.1400100,-293.5759900,1006.2299800,0.0000000,0.0000000,0.0000000,7), --object(shop_counter_3b,7), (1,7),
	createObject(2635,405.7999900,-300.3999900,1006.6599700,0.0000000,0.0000000,0.0000000,7), --object(cj_pizza_table,7), (3,7),
	createObject(1720,405.7999900,-299.6000100,1006.2399900,0.0000000,0.0000000,0.0000000,7), --object(rest_chair,7), (20,7),
	createObject(1720,405.7999900,-301.2000100,1006.2399900,0.0000000,0.0000000,180.0000000,7), --object(rest_chair,7), (21,7),
	createObject(3109,409.8999900,-293.0799900,1007.4000200,0.0000000,0.0000000,90.0000000,7), --object(imy_la_door,7), (1,7),
	createObject(2247,401.0000000,-301.3999900,1007.5000000,0.0000000,0.0000000,0.0000000,7), --object(plant_pot_15,7), (1,7),
	createObject(1510,401.0000000,-301.2000100,1007.0850200,0.0000000,0.0000000,0.0000000,7), --object(dyn_ashtry,7), (1,7),
	createObject(2247,409.8999900,-303.6000100,1007.5000000,0.0000000,0.0000000,0.0000000,7), --object(plant_pot_15,7), (2,7),
	createObject(2247,409.8999900,-300.3999900,1007.5000000,0.0000000,0.0000000,0.0000000,7), --object(plant_pot_15,7), (3,7),
	createObject(2247,409.8999900,-297.5000000,1007.5000000,0.0000000,0.0000000,0.0000000,7), --object(plant_pot_15,7), (4,7),
	createObject(2247,405.7999900,-300.2999900,1007.5000000,0.0000000,0.0000000,0.0000000,7), --object(plant_pot_15,7), (5,7),
	createObject(2247,401.0000000,-299.6000100,1007.5000000,0.0000000,0.0000000,0.0000000,7), --object(plant_pot_15,7), (6,7),
	createObject(2010,400.3999900,-304.1499900,1006.2399900,0.0000000,0.0000000,0.0000000,7), --object(nu_plant3_ofc,7), (1,7),
	createObject(1510,409.9500100,-300.2500000,1007.0850200,0.0000000,0.0000000,0.0000000,7), --object(dyn_ashtry,7), (2,7),
	createObject(2010,410.8999900,-293.6000100,1006.2000100,0.0000000,0.0000000,0.0000000,7), --object(nu_plant3_ofc,7), (2,7),
	createObject(2500,404.2999900,-293.2099900,1007.2700200,0.0000000,0.0000000,0.5200000,7), --object(cj_ff_coffee,7), (1,7),
	createObject(2342,404.7999900,-293.5000000,1007.4000200,0.0000000,0.0000000,0.0000000,7), --object(donut_disp,7), (1,7),
	createObject(2342,404.7998000,-293.5000000,1007.4099700,0.0000000,0.0000000,0.0000000,7), --object(donut_disp,7), (2,7),
	createObject(2342,404.7998000,-293.5000000,1007.4210200,0.0000000,0.0000000,0.0000000,7), --object(donut_disp,7), (3,7),
	createObject(2342,404.7998000,-293.5000000,1007.4210200,0.0000000,0.0000000,0.0000000,7), --object(donut_disp,7), (4,7),
	createObject(2342,404.7998000,-293.5000000,1007.4310300,0.0000000,0.0000000,0.0000000,7), --object(donut_disp,7), (5,7),
	createObject(2342,404.7998000,-293.5000000,1007.4403100,0.0000000,0.0000000,0.0000000,7), --object(donut_disp,7), (6,7),
	createObject(2342,404.7998000,-293.5000000,1007.4503200,0.0000000,0.0000000,0.0000000,7), --object(donut_disp,7), (7,7),
	createObject(2688,406.2999900,-293.2000100,1008.0000000,0.0000000,0.0000000,0.0000000,7), --object(cj_food_post4,7), (2,7),
	createObject(8710,395.5000000,-271.3999900,1036.3000500,90.0000000,0.0000000,0.0000000,7), --object(bnuhotel01_lvs,7), (2,7),
	createObject(18608,405.5000000,-302.5000000,1012.0999800,0.0000000,0.0000000,0.0000000,7), --object(counts_lights01,7), (1,7),

}

local col = createColSphere(403.23315, -304.4404, 1007.26221 , 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


