_Vehicule = _this select 0; // Récupère l'objet sur lequel l'action est "posée"
_position_Light_G = [0, 0, 0];
_position_Light_D = [0, 0, 0];
_lumiere_table_G = 21;
_lumiere_table_D = 22;
_activer_gyros = "BeaconsStart";
switch (typeOf _Vehicule) do {
case "B_GEN_Offroad_01_gen_F": {
_position_Light_G = [-0.6, 0, 0.60];
_position_Light_D = [0.5, 0, 0.60];
_lumiere_table_G = 21;
_lumiere_table_G = 22;
_activer_gyros = "BeaconsStart";
};
case "B_GEN_Offroad_01_covered_F": {
_position_Light_G = [-0.58, 0.2, 0.5];
_position_Light_D = [0.5, 0.2, 0.5];
_lumiere_table_G = 20;
_lumiere_table_G = 21;
_activer_gyros = "BeaconsStart";
};
default {
};
};
while {true} do
{
if ((_Vehicule animationPhase _activer_gyros) == 1 AND (((getAllHitPointsDamage _Vehicule) select 2 select _lumiere_table_G ) == 0 OR ((getAllHitPointsDamage _Vehicule) select 2 select _lumiere_table_D) == 0)) then
{
_angle_G = 270;
_angle_D = 90;
_angle_Rotation = 5;
_lumiere_G = "Reflector_Cone_01_Wide_Blue_F" createVehicleLocal (getPos _Vehicule); // Crée un cone de lumière sur le véhicule
_lumiere_G setDir (getDir _Vehicule + _angle_G); // Aligne la lumière
_lumiere_G attachTo [_Vehicule, _position_Light_G]; // Attache en position relative la lumière au véhicule.
_lumiere_D = "Reflector_Cone_01_Wide_Blue_F" createVehicleLocal (getPos _Vehicule);
_lumiere_D setDir (getDir _Vehicule + _angle_D);
_lumiere_D attachTo [_Vehicule, _position_Light_D];
while {(_Vehicule animationPhase _activer_gyros) == 1 AND (((getAllHitPointsDamage _Vehicule) select 2 select _lumiere_table_G) == 0 OR ((getAllHitPointsDamage _Vehicule) select 2 select _lumiere_table_D) == 0)} do
{
_angle_G = _angle_G + _angle_Rotation;
_lumiere_G setDir (getDir _Vehicule + _angle_G);
_angle_D = _angle_D + _angle_Rotation;
_lumiere_D setDir (getDir _Vehicule + _angle_D);
sleep 0.01;
};
deleteVehicle _lumiere_D;
deleteVehicle _lumiere_G;
_Vehicule animate ["BeaconsStart", 0]; //Coupe les strobe
};
};