_tex = _this select 0;

_camo = _this select 1;

switch (_this select 1) do 
{
	case "NATO" : 
	{
		_tex setObjectTexture [8,"\ch_m1abrams\data\m1a1\nato\m1abrams_01_co.paa"];
		_tex setObjectTexture [9,"\ch_m1abrams\data\m1a1\nato\m1abrams_02_co.paa"];
		_tex setObjectTexture [10,"\ch_m1abrams\data\m1a1\nato\m1abrams_03_co.paa"];
		_tex setObjectTexture [11,"\ch_m1abrams\data\m1a1\nato\m1abrams_04_co.paa"];
		_tex setObjectTexture [12,"\ch_m1abrams\data\m1a1\nato\m1abrams_track_co.paa"];
	};

	case "Desert" : 
	{
		_tex setObjectTexture [8,"\ch_m1abrams\data\m1a1\desert\m1abrams_01_co.paa"];
		_tex setObjectTexture [9,"\ch_m1abrams\data\m1a1\desert\m1abrams_02_co.paa"];
		_tex setObjectTexture [10,"\ch_m1abrams\data\m1a1\desert\m1abrams_03_co.paa"];
		_tex setObjectTexture [11,"\ch_m1abrams\data\m1a1\desert\m1abrams_04_co.paa"];
		_tex setObjectTexture [12,"\ch_m1abrams\data\m1a1\desert\m1abrams_track_co.paa"];
	};
};


//the following code is here to fix a bug with setObjectTexture command in singleplayer games
sleep 0.1;

waitUntil {time == 0};

CH_Textures = [_tex, _camo] execVM "\ch_m1abrams_cfg\scripts\m1a1\textures.sqf";