Автор: Mirk Вот написал скрипт:
Код:
_LiderName = _this select 0
_BATname = _this select 1
?(side _LiderName == east):_Storona=east
?(side _LiderName == west):_Storona=west
_Night= if (((Daytime>19.0)and(Daytime <23.9))or((Daytime>=0)and(Daytime <5.5))) then {1}
_OsV=0
#Targ
_NearestEnemy = leader _LiderName findNearestEnemy (getpos leader _LiderName)
_list = _NearestEnemy nearEntities 150;
_kord = getpos _NearestEnemy
if (((!IsNull _NearestEnemy)and(_Night==1))and(_OsV==0)) then {goto "osvet"}
_LMan="Man" CountType _list;
_LCar="CAR" CountType _list;
_LTank="TANK" CountType _list;
_Svoih= _Storona CountSide _list;
~1
?(_Svoih>0):leader _LiderName sidechat "People on calculation of battery! Cancel calculation."
while {IsNull _NearestEnemy} do {goto "Targ"}
if (((_LMan>5) or ((_LCar+_LTank)>0)) and (_Svoih==0) and alive _NearestEnemy) then {goto "ViborSnar"} else {goto "Targ"}
#osvet
leader _LiderName sidechat "LIGHTING"
~5
_snar=["IMMEDIATE","ILLUM",0,5]
_OsV=1
goto "bat"
#ViborSnar
~1
hintsilent format ["%1 -TARGET, %2 -VSEGO, %3 -MAN, %4 -CAR, %5 -TANK, %6 -SVOIH",typeOf _NearestEnemy,count _list,_LMan,_LCar,_LTank,_Svoih]
leader _LiderName sidechat "calculation battery"
~5
?((((_LMan>0)and(_LMan<=30))or(_LCar>0))and alive _NearestEnemy):_snar=["IMMEDIATE","HE",1,6]
?(_LMan>30 and alive _NearestEnemy):_snar=["IMMEDIATE","WP",1,10]
?(_LCar>2 and alive _NearestEnemy):_snar=["IMMEDIATE","HE",1,10]
?(((_LTank>0)and(_LTank<=2))and alive _NearestEnemy):_snar=["IMMEDIATE","SADARM",1,6]
?((_LTank>2) and alive _NearestEnemy):_snar=["IMMEDIATE","SADARM",1,10]
~5
hintsilent format ["%1 snar, %2 vistrelov", _snar select 1,_snar select 3]
leader _LiderName disableAI "Move"
_OsV=0
#bat
;поправка
_Vkord2 = getpos _NearestEnemy
_Krx = (_Vkord2 select 0)-(_kord select 0)
_Kry = (_Vkord2 select 1)-(_kord select 1)
_Kdx = ((_Krx)/15)*74
_Kdy = ((_Kry)/15)*74
_Kx = (_Kdx) + (_Krx)
_Ky = (_Kdy) + (_Kry)
_kordDV=[(_Kx) + (_kord select 0), (_Ky) + (_kord select 1), _kord select 2]
[_BATname, _kordDV, _snar] call BIS_ARTY_F_ExecuteTemplateMission
leader _BATname globalChat "BATTERY FIRE"
_tV= if (_OsV==0) then {100} else {35}
~_tV
leader _LiderName enableAI "Move"
goto "Targ"
exit
_LiderName = имя группы
_BATname = имя батареи
Пример миссии приатачен к посту.
Также, этой частью кода я пытался сделать поправку выстрела в кординаты, где должен оказаться дижущийся объект.
Код:
;поправка
_Vkord2 = getpos _NearestEnemy
_Krx = (_Vkord2 select 0)-(_kord select 0)
_Kry = (_Vkord2 select 1)-(_kord select 1)
_Kdx = ((_Krx)/15)*74
_Kdy = ((_Kry)/15)*74
_Kx = (_Kdx) + (_Krx)
_Ky = (_Kdy) + (_Kry)
_kordDV=[(_Kx) + (_kord select 0), (_Ky) + (_kord select 1), _kord select 2]
http://webfile.ru/3783726