starting

var gen5,gen6,gen7,gen8;
var imphc,ben4;

begin

if GetMultiplayerSetting(0) > 0 then begin
setside(blu,GetMultiplayerSetting(0));
wait(0$2);
setside(blutowhi,GetMultiplayerSetting(0));
setside(blutoora,GetMultiplayerSetting(0));
setside(blutoyel,GetMultiplayerSetting(0)); 
SetBattleFlag(GetMultiplayerSetting(0),200,137, [ [bfo_defend_bonus_human,0], [bfo_defend_bonus_vehicle,0], [bfo_defend_bonus_building,0], [bfo_range,0], [bfo_height,100] ]);
comhold(blu);

end
else
begin
removeunit(blu);
end;

if GetMultiplayerSetting(1) > 0 then begin
setside(yel,GetMultiplayerSetting(1));
wait(0$2);
setside(yeltoblu,GetMultiplayerSetting(1));
setside(yeltoora,GetMultiplayerSetting(1));
setside(yeltowhi,GetMultiplayerSetting(1));
SetBattleFlag(GetMultiplayerSetting(1),194,135, [ [bfo_defend_bonus_human,0], [bfo_defend_bonus_vehicle,0], [bfo_defend_bonus_building,0], [bfo_range,0], [bfo_height,100] ]);
comhold(yel);

end
else
begin
removeunit(yel);
end;

if GetMultiplayerSetting(2) > 0 then begin
setside(ora,GetMultiplayerSetting(2));
wait(0$2);
setside(oratoblu,GetMultiplayerSetting(2));
setside(oratoblu,GetMultiplayerSetting(2));
setside(oratowhi,GetMultiplayerSetting(2));
SetBattleFlag(GetMultiplayerSetting(2),202,145, [ [bfo_defend_bonus_human,0], [bfo_defend_bonus_vehicle,0], [bfo_defend_bonus_building,0], [bfo_range,0], [bfo_height,100] ]);
comhold(ora);

end
else
begin
removeunit(ora);
end;

if GetMultiplayerSetting(3) > 0 then begin
setside(whi,GetMultiplayerSetting(3));
wait(0$2);
setside(whitoblu,GetMultiplayerSetting(3));
setside(whitoora,GetMultiplayerSetting(3));
setside(whitoyel,GetMultiplayerSetting(3));
SetBattleFlag(GetMultiplayerSetting(3),196,145, [ [bfo_defend_bonus_human,0], [bfo_defend_bonus_vehicle,0], [bfo_defend_bonus_building,0], [bfo_range,0], [bfo_height,100] ]);
comhold(whi);

end
else
begin
removeunit(whi);
end;

// Préparation des options Multijoueur.
                                            
if GetMultiplayerSetting(4)=0 then
begin
revealfogarea(testarea,1);
revealfogarea(testarea,2);
revealfogarea(testarea,3);
revealfogarea(testarea,4);
revealfogarea(testarea,5);
revealfogarea(testarea,6);
revealfogarea(testarea,7);
revealfogarea(testarea,8);
end;

          if GetMultiplayerSetting(9)=0 then

             begin
             imphc:=0;
             end;

          if GetMultiplayerSetting(9)=1 then

             begin
             imphc:=105;
             end; 

if GetMultiplayerSetting(5)=1 then
    begin
    wait(0$5);
          hc_name := mp_sides_players_names[GetMultiplayerSetting(0)];
          uc_nation:= mp_sides_nations[GetMultiplayerSetting(0)];
          uc_side:=GetMultiplayerSetting(0);
          PrepareHuman(0,class_soldier,10);
          hc_importance:=imphc;
          hc_attr:=[10,10];
          hc_gallery:= 'MULTIAVATARS';
          hc_face_number:=Multiplayer_GetPlayerSideNum(GetMultiplayerSetting(0));
          hc_sex := Multiplayer_GetPlayerSex(GetMultiplayerSetting(0));

          gen5=createhuman;

          placeunitxyr(gen5,225,175,7,false);
    end;


if GetMultiplayerSetting(6)=1 then
    begin
    wait(0$5);
          hc_name := mp_sides_players_names[GetMultiplayerSetting(1)];
          uc_nation:= mp_sides_nations[GetMultiplayerSetting(1)];
          uc_side:=GetMultiplayerSetting(1);
          PrepareHuman(0,class_soldier,10);
          hc_importance:=imphc;
          hc_attr:=[10,10];
          hc_gallery:= 'MULTIAVATARS';
          hc_face_number:=Multiplayer_GetPlayerSideNum(GetMultiplayerSetting(1));
          hc_sex := Multiplayer_GetPlayerSex(GetMultiplayerSetting(1));

          gen6=createhuman;

          placeunitxyr(gen6,90,130,7,false);
    end;

if GetMultiplayerSetting(7)=1 then
    begin
    wait(0$5);
          hc_name := mp_sides_players_names[GetMultiplayerSetting(2)];
          uc_nation:= mp_sides_nations[GetMultiplayerSetting(2)];
          uc_side:=GetMultiplayerSetting(2);
          PrepareHuman(0,class_soldier,10);
          hc_importance:=imphc;
          hc_attr:=[10,10];
          hc_gallery:= 'MULTIAVATARS';
          hc_face_number:=Multiplayer_GetPlayerSideNum(GetMultiplayerSetting(2));
          hc_sex := Multiplayer_GetPlayerSex(GetMultiplayerSetting(2));

          gen7=createhuman;

          placeunitxyr(gen7,150,25,7,false);
    end;

if GetMultiplayerSetting(8)=1 then
    begin
    wait(0$5);
          hc_name := mp_sides_players_names[GetMultiplayerSetting(3)];
          uc_nation:= mp_sides_nations[GetMultiplayerSetting(3)];
          uc_side:=GetMultiplayerSetting(3);
          PrepareHuman(0,class_soldier,10);
          hc_importance:=imphc;
          hc_attr:=[10,10];
          hc_gallery:= 'MULTIAVATARS';
          hc_face_number:=Multiplayer_GetPlayerSideNum(GetMultiplayerSetting(3));
          hc_sex := Multiplayer_GetPlayerSex(GetMultiplayerSetting(3));

          gen8=createhuman;

          placeunitxyr(gen8,25,20,7,false);
    end;

if GetMultiplayerSetting(10)=0 then
   begin
   wait(0$2);
       removeunit(genc3);
   end
   else
   begin
       setside(genc3,GetMultiplayerSetting(0));
   end;

if GetMultiplayerSetting(11)=0 then
   begin
   wait(0$2);
       //removeunit(genc4);
   end
   else
   begin
       setside(genc4,GetMultiplayerSetting(1));
   end;

if GetMultiplayerSetting(12)=0 then
   begin
   wait(0$2);
       //removeunit(genc2);
   end
   else
   begin
       setside(genc2,GetMultiplayerSetting(2));
   end;

if GetMultiplayerSetting(13)=0 then
   begin
   wait(0$2);
       //removeunit(genc1);
   end
   else
   begin
       setside(genc1,GetMultiplayerSetting(3));
   end;

end;


every 0$2 do
begin
      AddCargo(genc1, mat_cans, 100);
      AddCargo(genc2, mat_cans, 100);
      AddCargo(genc3, mat_cans, 100);
      AddCargo(genc4, mat_cans, 100);
enable;
end;

