PHP Code:
//init.sqf of any mission with a player and an enemy unit named "ai"
//slightly modified version from the original one
[] spawn {
while {true} do {
sleep(0.2);
_nt = ai nearTargets 1000;
if (count(_nt)>0) then {
for [{_j=0}, {_j<count(_nt)}, {_j=_j+1}] do {
scopeName "checkplayer";
_ct = _nt select _j;
if ((_ct select 4) == player) then {
_loc = _ct select 0;
_rad = _ct select 5;
// hintSilent format["%1", [_loc distance player, _rad]];
//[ShapeName, AnimationName, Type, TimerPeriod, LifeTime, Position, MoveVelocity, RotationVelocity, Weight, Volume, Rubbing, Size, Color, AnimationPhase, RandomDirectionPeriod, RandomDirectionIntensity, OnTimer, BeforeDestroy, Object]
drop ["\Ca\Data\Cl_basic", "", "Billboard", 1, 1, _loc, [0, 0, 0], 0.05, 0.005, 0.0042, 1, [0.5,0.5], [[1,1,1,1],[1,1,1,0]], [0,1,0,1,0,1], 0.2, 0.2, "", "", ""];
if (_rad > 0) then {
_bdiv = 100 / (_rad * 3);
if (_bdiv<1) then {_bdiv = 1;};
for [{_k=0},{_k<360},{_k=_k+_bdiv}] do {
_pos = [(_loc select 0) + (sin(_k)*_rad), (_loc select 1) + (cos(_k)*_rad), _loc select 2];
drop ["\Ca\Data\Cl_basic", "", "Billboard", 1, 1, _pos, [0, 0, 0], 0.01, 0.005, 0.0042, 0, [0.25,0.25], [[1,0,0,1],[1,0,0,0]], [0,1,0,1,0,1], 0.2, 0.2, "", "", ""];
};
};
breakOut "checkplayer";
};
};
};
};
};