arma3_missions/helotraining_mp.Altis/spawnSmokeBySquad.sqf

41 lines
1.1 KiB
Plaintext
Raw Normal View History

2016-07-25 23:01:42 +00:00
//diag_log format["spawnSmokeBySquad called, _this: %1", _this];
2016-07-24 23:28:26 +00:00
private _bindToSquad = _this select 0;
2016-07-25 00:36:48 +00:00
private _smokeTgt = _this select 1;
private _smokeLocation = getPos _smokeTgt;
2016-07-24 23:28:26 +00:00
private _smokeColor = _this select 2;
2016-07-25 17:49:54 +00:00
private _trg = createTrigger["EmptyDetector", _smokeLocation, false];
2016-07-24 23:28:26 +00:00
_trg setTriggerArea[50,50,0,false];
_trg setTriggerActivation["WEST","PRESENT",false];
2016-07-25 00:36:48 +00:00
private _keepSpawning = true;
2016-07-24 23:28:26 +00:00
// TODO: switch color based on arguments
2016-07-25 00:36:48 +00:00
while {_keepSpawning} do
2016-07-24 23:28:26 +00:00
{
2016-07-25 23:01:42 +00:00
//diag_log format["spawnSmokeBySquad: spawning smoke to %1", _smokeLocation];
2016-07-24 23:28:26 +00:00
_hour = daytime;
if (_hour > 5 && _hour < 19) then
{
2016-07-25 00:36:48 +00:00
_smoke= "SmokeShellGreen" createVehicle _smokeLocation;
2016-07-24 23:28:26 +00:00
sleep 40;
deleteVehicle _smoke;
}
else
{
2016-07-25 00:36:48 +00:00
_chemlight= "Chemlight_green" createVehicle _smokeLocation;
_smoke= "SmokeShellGreen" createVehicle _smokeLocation;
2016-07-24 23:28:26 +00:00
sleep 40;
deleteVehicle _chemlight;
deleteVehicle _smoke;
};
2016-07-25 00:36:48 +00:00
_keepSpawning = false;
{
if (_x inArea _trg && alive _x) then
{
_keepSpawning = true;
};
} forEach (units _bindToSquad);
2016-07-24 23:28:26 +00:00
};
2016-07-25 23:01:42 +00:00
//diag_log format["spawnSmokeBySquad done, _this: %1", _this];
2016-07-24 23:28:26 +00:00
deleteVehicle _trg;