Например, в редакторе поставил стол, на него положил оружие, и к нему мне нужно прикрепить прицел, чтобы непосредственно в игре на данном столе это оружие лежало уже с установленным на него прицелом.
Как в редакторе на оружие добавить обвесы?
Автор:
BOPOH2022
, 22 Jul 2026 03:35
- Авторизуйтесь для ответа в теме
В теме одно сообщение
#2
OFFLINE
kok
kok
-
- Пользователи
-
- 1 сообщений
Рядовой
- Откуда:самара
Отправлено 28 September 2026 - 11:47
Hidden text
// ============================================================
// DYNAMIC CONFLICT SYSTEM v19.19 (v19.15 + ТАКТИЧЕСКИЕ СИСТЕМЫ)
// ============================================================
// ================ ОЧИСТКА ПРИ ПОВТОРНОМ ЗАПУСКЕ ================
if (!isNil "DYN_GUI_OPEN" && {DYN_GUI_OPEN}) then { call fnc_closeMainMenu; };
if (!isNil "DYN_CLEANUP_THREAD" && {!scriptDone DYN_CLEANUP_THREAD}) then { terminate DYN_CLEANUP_THREAD; };
if (!isNil "DYN_SCANNER_THREAD" && {!scriptDone DYN_SCANNER_THREAD}) then { terminate DYN_SCANNER_THREAD; };
if (!isNil "DYN_MED_THREAD" && {!scriptDone DYN_MED_THREAD}) then { terminate DYN_MED_THREAD; };
if (!isNil "DYN_AMMO_THREAD" && {!scriptDone DYN_AMMO_THREAD}) then { terminate DYN_AMMO_THREAD; };
if (!isNil "DYN_DRONE_BOOST_THREAD" && {!scriptDone DYN_DRONE_BOOST_THREAD}) then { terminate DYN_DRONE_BOOST_THREAD; };
if (!isNil "DYN_QUADBIKE_BOOST_THREAD" && {!scriptDone DYN_QUADBIKE_BOOST_THREAD}) then { terminate DYN_QUADBIKE_BOOST_THREAD; };
if (!isNil "DYN_RANK_BUFFS_THREAD" && {!scriptDone DYN_RANK_BUFFS_THREAD}) then { terminate DYN_RANK_BUFFS_THREAD; };
if (!isNil "DYN_AI_THREADS") then { { if (!scriptDone _x) then { terminate _x; }; } forEach DYN_AI_THREADS; };
if (!isNil "DYN_SMART_VEHICLE_THREADS") then { { if (!scriptDone _x) then { terminate _x; }; } forEach DYN_SMART_VEHICLE_THREADS; };
if (!isNil "DYN_SS_GLOBAL_THREADS") then { { if (!scriptDone _x) then { terminate _x; }; } forEach DYN_SS_GLOBAL_THREADS; };
if (!isNil "DYN_SS_GLOBAL_ATTACK_THREAD" && {!scriptDone DYN_SS_GLOBAL_ATTACK_THREAD}) then { terminate DYN_SS_GLOBAL_ATTACK_THREAD; };
if (!isNil "DYN_SS_RESPAWN_THREAD" && {!scriptDone DYN_SS_RESPAWN_THREAD}) then { terminate DYN_SS_RESPAWN_THREAD; };
if (!isNil "DYN_SS_MEGA_BLAST_THREAD" && {!scriptDone DYN_SS_MEGA_BLAST_THREAD}) then { terminate DYN_SS_MEGA_BLAST_THREAD; };
if (!isNil "GZ_RADAR_THREAD" && {!scriptDone GZ_RADAR_THREAD}) then { terminate GZ_RADAR_THREAD; };
DYN_AI_ACTIVE = false; DYN_SMART_VEHICLE_ACTIVE = false; DYN_MED_DRONES_ACTIVE = false; DYN_SCANNER_ACTIVE = false; DYN_SCANNER_RUNNING = false; DYN_MINIMAP_ACTIVE = false; DYN_SUPER_SOLDIERS_ACTIVE = false; DYN_DRONE_BOOST_ACTIVE = false; DYN_QUADBIKE_BOOST_ACTIVE = false;
DYN_SS_GLOBAL_ATTACK_ACTIVE = false;
GZ_isControllingDrone = false; GZ_isControllingPlane = false; GZ_isControllingMegaDrone = false;
if (!isNil "DYN_SCANNER_EH" && {DYN_SCANNER_EH != -1}) then { removeMissionEventHandler ["Draw3D", DYN_SCANNER_EH]; DYN_SCANNER_EH = -1; };
if (!isNil "DYN_MINIMAP_EH" && {DYN_MINIMAP_EH != -1}) then { removeMissionEventHandler ["Draw3D", DYN_MINIMAP_EH]; DYN_MINIMAP_EH = -1; };
if (!isNil "DYN_ENTITY_KILLED_EH") then { removeMissionEventHandler ["EntityKilled", DYN_ENTITY_KILLED_EH]; DYN_ENTITY_KILLED_EH = -1; };
{ try { deleteMarkerLocal _x; } catch {}; } forEach allRadarMarkers; allRadarMarkers = [];
{ try { deleteMarkerLocal _x; } catch {}; } forEach allDroneMarkers; allDroneMarkers = [];
systemChat "DYN: Старые процессы очищены. Запуск v19.19...";
// ================ ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ ================
if (isNil "DYN_SMART_VEHICLES") then { DYN_SMART_VEHICLES = []; };
if (isNil "DYN_SMART_VEHICLE_ACTIVE") then { DYN_SMART_VEHICLE_ACTIVE = false; };
if (isNil "DYN_DRONE_BOOST_ACTIVE") then { DYN_DRONE_BOOST_ACTIVE = false; };
if (isNil "DYN_QUADBIKE_BOOST_ACTIVE") then { DYN_QUADBIKE_BOOST_ACTIVE = false; };
if (isNil "DYN_SCANNER_ACTIVE") then { DYN_SCANNER_ACTIVE = false; };
if (isNil "DYN_SCANNER_MARKERS") then { DYN_SCANNER_MARKERS = []; };
if (isNil "DYN_SCANNER_EH") then { DYN_SCANNER_EH = -1; };
if (isNil "DYN_SCANNER_NEAREST_COUNT") then { DYN_SCANNER_NEAREST_COUNT = 5; };
if (isNil "DYN_SCANNER_RUNNING") then { DYN_SCANNER_RUNNING = false; };
if (isNil "DYN_RESPAWN_ENABLED") then { DYN_RESPAWN_ENABLED = true; };
if (isNil "DYN_PLAYER_LOADOUT") then { DYN_PLAYER_LOADOUT = []; };
if (isNil "DYN_PLAYER_UNIT_TYPE") then { DYN_PLAYER_UNIT_TYPE = ""; };
if (isNil "DYN_PLAYER_SIDE") then { DYN_PLAYER_SIDE = east; };
if (isNil "DYN_MAIN_PLAYER_POS") then { DYN_MAIN_PLAYER_POS = []; };
if (isNil "DYN_PLAYER_DEATH_SIDE") then { DYN_PLAYER_DEATH_SIDE = east; };
if (isNil "DYN_SWITCH_MODE") then { DYN_SWITCH_MODE = false; };
if (isNil "DYN_MAIN_PLAYER") then { DYN_MAIN_PLAYER = objNull; };
if (isNil "DYN_SWITCH_MAP_MARKERS") then { DYN_SWITCH_MAP_MARKERS = []; };
if (isNil "DYN_SWITCH_MAP_EH") then { DYN_SWITCH_MAP_EH = -1; };
if (isNil "DYN_GUI_OPEN") then { DYN_GUI_OPEN = false; };
if (isNil "DYN_GUI_PERSISTENT") then { DYN_GUI_PERSISTENT = []; };
if (isNil "DYN_GUI_CONTENT") then { DYN_GUI_CONTENT = []; };
if (isNil "DYN_GUI_TABS") then { DYN_GUI_TABS = []; };
if (isNil "DYN_GUI_CURRENT_TAB") then { DYN_GUI_CURRENT_TAB = ""; };
if (isNil "DYN_AMMO_COUNTER_ACTIVE") then { DYN_AMMO_COUNTER_ACTIVE = true; };
if (isNil "DYN_AMMO_LAST_COUNT") then { DYN_AMMO_LAST_COUNT = -1; };
if (isNil "DYN_RTS_selectedUnits") then { DYN_RTS_selectedUnits = []; };
if (isNil "DYN_RTS_selecting") then { DYN_RTS_selecting = false; };
if (isNil "DYN_RTS_awaitingOrder") then { DYN_RTS_awaitingOrder = false; };
if (isNil "DYN_RTS_selectionStart") then { DYN_RTS_selectionStart = [0,0]; };
if (isNil "DYN_RTS_selectionEnd") then { DYN_RTS_selectionEnd = [0,0]; };
if (isNil "DYN_RTS_lastMouseDown") then { DYN_RTS_lastMouseDown = [0,0,0]; };
if (isNil "DYN_RTS_dragThreshold") then { DYN_RTS_dragThreshold = 5; };
if (isNil "DYN_RTS_mouseDownEH") then { DYN_RTS_mouseDownEH = -1; };
if (isNil "DYN_RTS_mouseMovingEH") then { DYN_RTS_mouseMovingEH = -1; };
if (isNil "DYN_RTS_mouseUpEH") then { DYN_RTS_mouseUpEH = -1; };
if (isNil "DYN_RTS_keyDownEH") then { DYN_RTS_keyDownEH = -1; };
if (isNil "DYN_RTS_draw3DEH") then { DYN_RTS_draw3DEH = -1; };
if (isNil "DYN_AI_ACTIVE") then { DYN_AI_ACTIVE = false; };
if (isNil "DYN_AI_MONITOR_INTERVAL") then { DYN_AI_MONITOR_INTERVAL = 60; };
if (isNil "DYN_AI_MIN_UNITS") then { DYN_AI_MIN_UNITS = 15; };
if (isNil "DYN_AI_MAX_UNITS") then { DYN_AI_MAX_UNITS = 70; };
if (isNil "DYN_AI_MAX_VEHICLES") then { DYN_AI_MAX_VEHICLES = 3; };
if (isNil "DYN_AI_MAX_AIR") then { DYN_AI_MAX_AIR = 2; };
if (isNil "DYN_AI_ARTILLERY_ACTIVE") then { DYN_AI_ARTILLERY_ACTIVE = false; };
if (isNil "DYN_AI_COMMAND_ACTIVE") then { DYN_AI_COMMAND_ACTIVE = false; };
if (isNil "DYN_SUPPORT_TURRETS") then { DYN_SUPPORT_TURRETS = []; };
if (isNil "DYN_KAMIKAZE_DRONES") then { DYN_KAMIKAZE_DRONES = []; };
if (isNil "DYN_WOUNDED_UNITS") then { DYN_WOUNDED_UNITS = []; };
if (isNil "DYN_LOADOUTS") then { DYN_LOADOUTS = [[],[],[],[],[]]; };
if (isNil "DYN_ARSENAL_OPEN") then { DYN_ARSENAL_OPEN = false; };
if (isNil "DYN_VEHICLE_LAST_SPAWN_TIME") then { DYN_VEHICLE_LAST_SPAWN_TIME = -1800; };
if (isNil "DYN_TURRET_LAST_SPAWN_TIME") then { DYN_TURRET_LAST_SPAWN_TIME = -600; };
if (isNil "DYN_EVENT_LOG") then { DYN_EVENT_LOG = []; };
if (isNil "DYN_EVENT_LOG_MAX") then { DYN_EVENT_LOG_MAX = 50; };
if (isNil "DYN_MINIMAP_ACTIVE") then { DYN_MINIMAP_ACTIVE = false; };
if (isNil "DYN_MINIMAP_EH") then { DYN_MINIMAP_EH = -1; };
if (isNil "DYN_MINIMAP_RANGE") then { DYN_MINIMAP_RANGE = 500; };
if (isNil "DYN_MINIMAP_CACHE") then { DYN_MINIMAP_CACHE = []; };
if (isNil "DYN_MINIMAP_CACHE_TIME") then { DYN_MINIMAP_CACHE_TIME = 0; };
if (isNil "DYN_PLAYER_XP") then { DYN_PLAYER_XP = profileNamespace getVariable ["DYN_PLAYER_XP", 0]; };
if (isNil "DYN_PLAYER_RANK") then { DYN_PLAYER_RANK = profileNamespace getVariable ["DYN_PLAYER_RANK", 0]; };
if (isNil "DYN_KILLS_COUNT") then { DYN_KILLS_COUNT = profileNamespace getVariable ["DYN_KILLS_COUNT", 0]; };
if (isNil "DYN_RANKS") then { DYN_RANKS = [["Рядовой",0],["Ефрейтор",100],["Мл. сержант",250],["Сержант",500],["Ст. сержант",800],["Прапорщик",1200],["Мл. лейтенант",1700],["Лейтенант",2300],["Капитан",3000],["Майор",4000]]; };
if (isNil "DYN_HOTKEYS_ENABLED") then { DYN_HOTKEYS_ENABLED = true; };
if (isNil "DYN_QUADBIKE_TARGET_SPEED") then { DYN_QUADBIKE_TARGET_SPEED = 97.22; };
if (isNil "DRONE_autoPilotActive") then { DRONE_autoPilotActive = false; };
if (isNil "DYN_AI_VEHICLES_SPAWNED") then { DYN_AI_VEHICLES_SPAWNED = []; };
if (isNil "DYN_QUADBIKE_BOOST_THREAD") then { DYN_QUADBIKE_BOOST_THREAD = scriptNull; };
if (isNil "DYN_MED_DRONES_ACTIVE") then { DYN_MED_DRONES_ACTIVE = false; };
if (isNil "DYN_MED_DRONES") then { DYN_MED_DRONES = []; };
if (isNil "DYN_MED_VEHICLES") then { DYN_MED_VEHICLES = []; };
if (isNil "DYN_AI_THREADS") then { DYN_AI_THREADS = []; };
if (isNil "DYN_SCANNER_THREAD") then { DYN_SCANNER_THREAD = scriptNull; };
if (isNil "DYN_MED_THREAD") then { DYN_MED_THREAD = scriptNull; };
if (isNil "DYN_SMART_VEHICLE_THREADS") then { DYN_SMART_VEHICLE_THREADS = []; };
if (isNil "DYN_AMMO_THREAD") then { DYN_AMMO_THREAD = scriptNull; };
if (isNil "DYN_DRONE_BOOST_THREAD") then { DYN_DRONE_BOOST_THREAD = scriptNull; };
if (isNil "DYN_HOTKEY_EH") then { DYN_HOTKEY_EH = -1; };
if (isNil "DYN_CLEANUP_THREAD") then { DYN_CLEANUP_THREAD = scriptNull; };
if (isNil "DYN_SUPER_SOLDIERS_ACTIVE") then { DYN_SUPER_SOLDIERS_ACTIVE = false; };
if (isNil "DYN_SS_GLOBAL_THREADS") then { DYN_SS_GLOBAL_THREADS = []; };
if (isNil "DYN_RANK_BUFFS_THREAD") then { DYN_RANK_BUFFS_THREAD = scriptNull; };
if (isNil "DYN_ENTITY_KILLED_EH") then { DYN_ENTITY_KILLED_EH = -1; };
if (isNil "DYN_SS_GLOBAL_ATTACK_ACTIVE") then { DYN_SS_GLOBAL_ATTACK_ACTIVE = false; };
if (isNil "DYN_SS_GLOBAL_ATTACK_THREAD") then { DYN_SS_GLOBAL_ATTACK_THREAD = scriptNull; };
if (isNil "DYN_SS_RESPAWN_THREAD") then { DYN_SS_RESPAWN_THREAD = scriptNull; };
if (isNil "DYN_SS_MEGA_BLAST_THREAD") then { DYN_SS_MEGA_BLAST_THREAD = scriptNull; };
if (isNil "SS_REINFORCEMENT_SPAWNED") then { SS_REINFORCEMENT_SPAWNED = false; };
// Новые переменные из тактического скрипта
if (isNil "GZ_isControllingDrone") then { GZ_isControllingDrone = false; };
if (isNil "GZ_isControllingPlane") then { GZ_isControllingPlane = false; };
if (isNil "GZ_isControllingMegaDrone") then { GZ_isControllingMegaDrone = false; };
if (isNil "GZ_markerCounter") then { GZ_markerCounter = 0; };
if (isNil "artilleryUnits") then { artilleryUnits = []; };
if (isNil "artilleryGroup") then { artilleryGroup = grpNull; };
if (isNil "supportUnits") then { supportUnits = []; };
if (isNil "allDroneMarkers") then { allDroneMarkers = []; };
if (isNil "allRadarMarkers") then { allRadarMarkers = []; };
if (isNil "radarActive") then { radarActive = false; };
if (isNil "GZ_RADAR_THREAD") then { GZ_RADAR_THREAD = scriptNull; };
// ================ КЛАССЫ ================
DRONE_CLASSES = ["WNZ_AR86_Wasp_O","WNZ_UGV_32_Stalker_O","WNZ_UGV_31_Hunter_O","WNZ_UCAV_130_Custodian_105mm_O","O_WNZ_MQ14","O_UGV_02_Demining_F","HE_drone_Opfor","WNZ_AR81_Wasp_O","O_Crocus_AP","O_Crocus_AT","O_UGV_02_Sniper_F","mavik_3T_OPF","O_WNZ_MQ11","O_WNZ_MQ13","O_WNZ_MQ15","WNZ_UGV_36_Spotter_O","O_UAV_02_dynamicLoadout_F","WNZ_UCAV_Guardian_AA_O"];
DRONE_GROUND_CLASSES = ["WNZ_UGV_32_Stalker_O","WNZ_UGV_31_Hunter_O","WNZ_UGV_36_Spotter_O","O_UGV_02_Demining_F","O_UGV_02_Sniper_F"];
if (isNil "droneSpawnAltitude") then { droneSpawnAltitude = 500; };
if (isNil "DRONE_allSpawnedDrones") then { DRONE_allSpawnedDrones = []; };
DYN_SMART_VEHICLE_TYPES = ["O_MBT_02_cannon_F","O_APC_Tracked_02_cannon_F","O_APC_Wheeled_02_rcws_F","O_MRAP_02_hmg_F","O_MRAP_02_gmg_F","O_APC_Tracked_02_AA_F","O_MBT_04_command_F","O_APC_Wheeled_02_rcws_v2_F"];
DYN_KAMIKAZE_DRONE_TYPES = ["O_UAV_01_F","O_UAV_02_F","O_UAV_06_F"];
DYN_TURRET_TYPES = [["O_HMG_01_high_F","Пулемёт HMG (высокий)"],["O_GMG_01_high_F","Гранатомёт GMG (высокий)"],["O_HMG_01_F","Пулемёт HMG (низкий)"],["O_GMG_01_F","Гранатомёт GMG (низкий)"],["O_static_AA_F","ПЗРК статичный"],["O_static_AT_F","ПТРК статичный"]];
DYN_FORT_TYPES = [["Land_BagFence_Round_F","Мешок (круглый)"],["Land_BagFence_Long_F","Мешок (длинный)"],["Land_Hedgehog_F","Противотанковый ёж"],["Land_CncWall4_F","Бетонная стена"],["Land_Razorwire_F","Колючая проволока"],["Land_BagBunker_Small_F","Малый бункер"],["Land_BagBunker_Large_F","Большой бункер"],["Land_HBarrier_5_F","H-барьер"]];
// Константы тактической системы
MEGA_DRONE_CLASS = "HE_drone_Opfor"; MEGA_DRONE_ALT = 500; MEGA_EXPLOSIONS_COUNT = 40;
ATTACK_PLANE_CLASS = "O_Plane_CAS_02_F"; ATTACK_PLANE_START_SPEED = 138.89; ATTACK_PLANE_ALT = 1500;
playerReinforcementInfantry = ["O_Soldier_F","O_Soldier_GL_F","O_HeavyGunner_F","O_medic_F","O_Soldier_LAT_F","O_Soldier_AA_F"];
// ============================================================
// F-35 LIGHTNING II (точная схема пилонов из вашего скана)
// ============================================================
DYN_F35_CANDIDATES = [
"CUP_B_F35B_Stealth_BAF", "CUP_B_F35B_BAF", "CUP_B_F35C_Stealth_BAF", "CUP_B_F35C_BAF",
"CUP_B_F35B_Stealth_USMC", "CUP_B_F35B_USMC", "CUP_B_F35C_Stealth_USMC", "CUP_B_F35C_USMC",
"F_35B_lightningII","F_35C_lightningII", "F35B_lightningII","F35C_lightningII",
"USAF_F35B","USAF_F35C", "JSF_F35B","JSF_F35C"
];
DYN_F35_PYLON_LOADOUT = [
"rhs_mag_9M120f_16","rhs_mag_9M120f_16","rhs_mag_9M120f_16",
"CUP_PylonPod_19Rnd_CRV7_HE_plane_M","CUP_PylonPod_19Rnd_CRV7_HE_plane_M",
"CUP_PylonWeapon_220Rnd_TE1_Red_Tracer_GAU22_M",
"CUP_PylonPod_19Rnd_CRV7_HE_plane_M","CUP_PylonPod_19Rnd_CRV7_HE_plane_M",
"rhs_mag_9M120f_16","rhs_mag_9M120f_16","rhs_mag_9M120f_16"
];
fnc_detectF35 = {
private _found = [];
{ if (isClass (configFile >> "CfgVehicles" >> _x)) then { _found pushBack _x; }; } forEach DYN_F35_CANDIDATES;
if (count _found == 0) then {
{ private _dn = toLower (getText (_x >> "displayName")); if ("f-35" in _dn || "f35" in _dn) then { private _cn = configName _x; if (!(_cn in _found)) then { _found pushBack _cn; }; }; } forEach ("true" configClasses (configFile >> "CfgVehicles"));
};
_found
};
DYN_F35_CLASSES = call fnc_detectF35;
fnc_applyF35Loadout = {
params ["_aircraft"];
if (isNull _aircraft) exitWith {};
private _pylonCount = count (getPylonMagazines _aircraft);
if (_pylonCount == 0) exitWith {};
{ private _idx = _forEachIndex + 1; if (_idx <= _pylonCount) then { if (isClass (configFile >> "CfgMagazines" >> _x)) then { _aircraft setPylonLoadout [_idx, _x]; }; }; } forEach DYN_F35_PYLON_LOADOUT;
_aircraft setVehicleAmmo 1;
};
fnc_spawnF35 = {
params ["_className"];
if (DYN_ARSENAL_OPEN) exitWith { hint "Закройте арсенал!" };
if (!isClass (configFile >> "CfgVehicles" >> _className)) exitWith { hint "Класс F-35 не найден!"; };
private _spawnPos = (getPos player) getPos [3000 + random 1000, random 360]; _spawnPos set [2, 5000];
private _dir = random 360;
private _aircraft = createVehicle [_className, _spawnPos, [], 0, "FLY"];
_aircraft setDir _dir; _aircraft setVelocity [80 * sin _dir, 80 * cos _dir, 0];
private _grp = createGroup east; createVehicleCrew _aircraft; (crew _aircraft) joinSilent _grp;
{ _x setVariable ["DYN_SIDE", east, true]; _x setSkill 0.9; } forEach (crew _aircraft);
[_aircraft] call fnc_applyF35Loadout;
_aircraft addEventHandler ["Fired", { params ["_veh"]; _veh setVehicleAmmo 1; }];
[_aircraft] spawn { params ["_a"]; while {alive _a} do { _a setVehicleAmmo 1; _a setFuel 1; if (damage _a > 0.3) then { _a setDamage 0; }; sleep 3; }; };
private _pilot = driver _aircraft;
if (!isNull _pilot) then {
missionNamespace setVariable ["DYN_AIRCRAFT_ORIGINAL_PLAYER", player];
selectPlayer _pilot; DYN_SWITCH_MODE = true;
[_pilot] call fnc_attachMenuToUnit; [_pilot] call fnc_addSwitchDeathHandler;
};
_aircraft addEventHandler ["Killed", { [] spawn { sleep 1; private _orig = missionNamespace getVariable ["DYN_AIRCRAFT_ORIGINAL_PLAYER", objNull]; if (!isNull _orig && alive _orig && player != _orig) then { selectPlayer _orig; DYN_SWITCH_MODE = false; [_orig] call fnc_attachMenuToUnit; }; }; }];
["АВИАЦИЯ", format ["F-35 создан на 5000м: %1", getText (configFile >> "CfgVehicles" >> _className >> "displayName")], ""] call DYN_addEvent;
hint format ["✈ %1 на 5000м! 6x 9M120F HE + 4x CRV7 HE + GAU-22/A", getText (configFile >> "CfgVehicles" >> _className >> "displayName")];
call fnc_closeMainMenu;
};
fnc_guiShowAircraftMenu = {
call fnc_guiClearContent; [0] call fnc_guiHighlightTab;
private _d = uiNamespace getVariable ["DYN_GUI_Display", displayNull]; if (isNull _d) exitWith {};
private _bx=0.40; private _bw=0.56; private _bh=0.032; private _g=0.004; private _y=0.155;
[_d, "✈ F-35 LIGHTNING II (5000м, БОЕВАЯ ЗАГРУЗКА)", _bx, _y, _bw, 0.03, [1,0.8,0,1], 0.04] call fnc_guiCreateText; _y = _y + 0.035;
[_d, "Пилоны: 6x 9M120F HE + 4x 19x CRV7 HE + GAU-22/A (220)", _bx, _y, _bw, 0.025, [0.8,0.8,0.8,1], 0.025] call fnc_guiCreateText; _y = _y + 0.03;
if (count DYN_F35_CLASSES == 0) then {
[_d, "⚠ F-35 НЕ НАЙДЕН! Проверьте мод CUP", _bx, _y, _bw, 0.03, [1,0.3,0.3,1], 0.03] call fnc_guiCreateText; _y = _y + 0.04;
} else {
{ private _cn = _x; private _dn = getText (configFile >> "CfgVehicles" >> _cn >> "displayName"); private _cd = compile format ["['%1'] call fnc_spawnF35;", _cn]; [_d, format ["✈ %1", _dn], _bx, _y, _bw, _bh, _cd, [0,0.3,0.6,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g; } forEach DYN_F35_CLASSES;
};
_y = _y + _g*2;
[_d, "↩ НАЗАД", _bx, _y, _bw, _bh, { call fnc_guiShowTabCombat; }, [0,0,0,0.95]] call fnc_guiCreateButton;
};
// ================ ЖУРНАЛ ================
DYN_addEvent = {
params ["_type","_message","_details"];
if (isNil "_details") then { _details = ""; };
private _h = floor(daytime); private _m = floor((daytime - _h)*60); private _s = floor((((daytime - _h)*60) - _m)*60);
private _ts = format ["%1:%2:%3", _h, _m, _s];
DYN_EVENT_LOG pushBack [_ts, _type, _message, _details];
if (count DYN_EVENT_LOG > DYN_EVENT_LOG_MAX) then { DYN_EVENT_LOG deleteAt 0; };
systemChat format ["[%1] %2: %3", _ts, _type, _message];
};
DYN_clearEventLog = { DYN_EVENT_LOG = []; hint "Журнал очищен"; };
DYN_getRecentEvents = {
params ["_count"]; if (isNil "_count") then { _count = 10; };
private _start = (count DYN_EVENT_LOG) - _count; if (_start < 0) then { _start = 0; };
DYN_EVENT_LOG select [_start, _count]
};
// ================ МИНИ-РАДАР ================
DYN_createMinimap = {
if (DYN_MINIMAP_ACTIVE) exitWith {};
DYN_MINIMAP_ACTIVE = true; DYN_MINIMAP_CACHE = []; DYN_MINIMAP_CACHE_TIME = 0;
DYN_MINIMAP_EH = addMissionEventHandler ["Draw3D", {
if (!DYN_MINIMAP_ACTIVE) exitWith {};
if (time - DYN_MINIMAP_CACHE_TIME > 1) then {
DYN_MINIMAP_CACHE_TIME = time;
DYN_MINIMAP_CACHE = allUnits select { alive _x && !isPlayer _x && (_x distance player) < DYN_MINIMAP_RANGE };
};
{ if (alive _x) then { private _ep = getPos _x; private _color = if (side _x == east) then { [0,1,0,0.8] } else { [1,0,0,0.9] }; drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", _color, [_ep select 0, _ep select 1, (_ep select 2)+2], 1, 1, 0, "", 0, 0.03, "TahomaB"]; }; } forEach DYN_MINIMAP_CACHE;
}];
hint "Мини-радар активирован"; ["РАДАР","Мини-радар включен",""] call DYN_addEvent;
};
DYN_toggleMinimap = {
if (DYN_MINIMAP_ACTIVE) then {
DYN_MINIMAP_ACTIVE = false;
if (DYN_MINIMAP_EH != -1) then { removeMissionEventHandler ["Draw3D", DYN_MINIMAP_EH]; DYN_MINIMAP_EH = -1; };
DYN_MINIMAP_CACHE = []; hint "Мини-радар выключен";
} else { call DYN_createMinimap; };
};
// ================ ЗВАНИЯ И БОНУСЫ ================
DYN_addXP = {
params ["_amount","_reason"]; if (isNil "_reason") then { _reason = "действие"; };
DYN_PLAYER_XP = DYN_PLAYER_XP + _amount; profileNamespace setVariable ["DYN_PLAYER_XP", DYN_PLAYER_XP]; saveProfileNamespace;
private _nri = DYN_PLAYER_RANK + 1;
if (_nri < count DYN_RANKS) then {
private _nr = DYN_RANKS select _nri; private _xpN = _nr select 1;
if (DYN_PLAYER_XP >= _xpN) then {
DYN_PLAYER_RANK = _nri; profileNamespace setVariable ["DYN_PLAYER_RANK", DYN_PLAYER_RANK]; saveProfileNamespace;
private _nn = _nr select 0;
hint parseText format ["<t size='1.5' color='#FFD700'> ПОВЫШЕНИЕ!</t><br/><t size='1.2'>%1</t><br/><t>XP: %2</t>", _nn, DYN_PLAYER_XP];
["РАНГ", format ["Повышение до %1", _nn], ""] call DYN_addEvent;
};
};
systemChat format ["+%1 XP за %2 (Всего: %3)", _amount, _reason, DYN_PLAYER_XP];
};
DYN_getRankInfo = {
private _cr = DYN_RANKS select DYN_PLAYER_RANK; private _rn = _cr select 0; private _cxp = _cr select 1;
private _nri = DYN_PLAYER_RANK + 1; private _nxp = if (_nri < count DYN_RANKS) then { (DYN_RANKS select _nri) select 1 } else { 9999 };
private _pr = if (_nxp > _cxp) then { ((DYN_PLAYER_XP - _cxp) / (_nxp - _cxp)) * 100 } else { 100 };
[_rn, DYN_PLAYER_XP, _cxp, _nxp, _pr]
};
DYN_onPlayerKill = {
params ["_victim","_killer"];
if (isNull _killer || _killer != player) exitWith {};
private _xpG = 10; private _rsn = "убийство пехоты";
if (_victim isKindOf "Tank" || _victim isKindOf "APC") then { _xpG = 50; _rsn = "уничтожение техники"; }
else { if (_victim isKindOf "Air") then { _xpG = 40; _rsn = "сбитие авиации"; } else { if (vehicle _victim != _victim) then { _xpG = 30; _rsn = "уничтожение в технике"; }; }; };
DYN_KILLS_COUNT = DYN_KILLS_COUNT + 1; profileNamespace setVariable ["DYN_KILLS_COUNT", DYN_KILLS_COUNT]; saveProfileNamespace;
[_xpG, _rsn] call DYN_addXP;
["УБИЙСТВО", format ["Враг уничтожен (+%1 XP)", _xpG], ""] call DYN_addEvent;
};
fnc_applyRankBuffs = {
while {true} do {
if (!isNull player && alive player) then {
private _rank = DYN_PLAYER_RANK; DYN_AI_MAX_UNITS = 70 + (_rank * 5);
if (_rank > 0 && damage player > 0) then { player setDamage ((damage player) - (0.02 * _rank)); };
if (_rank >= 3 && getFatigue player > 0) then { player setFatigue 0; };
};
sleep 10;
};
};
fnc_addRankDamageHandler = {
params ["_u"]; if (isNull _u) exitWith {};
private _existing = _u getVariable ["DYN_RANK_DMG_EH", -1];
if (_existing != -1) then { _u removeEventHandler ["HandleDamage", _existing]; };
private _eh = _u addEventHandler ["HandleDamage", {
params ["_unit", "_selection", "_damage", "_source", "_projectile", "_hitIndex", "_instigator", "_hitPoint"];
private _rank = DYN_PLAYER_RANK;
if (_rank >= 5 && _selection == "") then { _damage = _damage * (1 - ((_rank - 4) * 0.10)); };
_damage
}];
_u setVariable ["DYN_RANK_DMG_EH", _eh];
};
// ================ ГОРЯЧИЕ КЛАВИШИ ================
DYN_setupHotkeys = {
private _display = findDisplay 46;
if (isNull _display || DYN_HOTKEY_EH != -1) exitWith {};
DYN_HOTKEY_EH = _display displayAddEventHandler ["KeyDown", {
params ["_display","_key","_shift","_ctrl","_alt"];
if (!DYN_HOTKEYS_ENABLED || DYN_GUI_OPEN || DYN_ARSENAL_OPEN) exitWith { false };
private _h = false;
switch (_key) do { case 59: { call fnc_callSmartMissileStrike; _h = true; }; case 60: { call fnc_aviationRocketStrikeAtMap; _h = true; }; case 65: { call fnc_callReinforcement; _h = true; }; case 66: { call fnc_callTank; _h = true; }; };
_h
}];
systemChat "Горячие клавиши активированы (F1-F2, F7-F8)";
};
DYN_toggleHotkeys = { DYN_HOTKEYS_ENABLED = !DYN_HOTKEYS_ENABLED; if (DYN_HOTKEYS_ENABLED) then { hint "Горячие клавиши ВКЛЮЧЕНЫ"; } else { hint "Горячие клавиши ВЫКЛЮЧЕНЫ"; }; };
// ================ ВСПОМОГАТЕЛЬНЫЕ ================
fnc_getUnitRole = { params ["_u"]; private _t = typeOf _u; if (_t find "AA" != -1) exitWith { "ПЗРК" }; if (_t find "AT" != -1) exitWith { "ПТРК" }; if (_t find "LAT" != -1) exitWith { "РПГ" }; if (_t find "AR" != -1) exitWith { "Пулемётчик" }; if (_t find "GL" != -1) exitWith { "Гранатомётчик" }; if (_t find "Sniper" != -1 || _t find "Sharpshooter" != -1) exitWith { "Снайпер" }; if (_t find "HeavyGunner" != -1) exitWith { "Пулемётчик" }; if (_t find "Medic" != -1) exitWith { "Медик" }; if (_t find "SL" != -1 || _t find "TL" != -1) exitWith { "Командир" }; "Пехота" };
fnc_getUnitTypeName = { params ["_u"]; if (_u isKindOf "Man") then { [_u] call fnc_getUnitRole } else { private _v = vehicle _u; if (_v isKindOf "Tank") exitWith { "Танк" }; if (_v isKindOf "APC") exitWith { "БМП" }; if (_v isKindOf "Car") exitWith { "Машина" }; if (_v isKindOf "Air") exitWith { "Авиация" }; if (_v isKindOf "Quadbike") exitWith { "Квадроцикл" }; "Техника" }; };
fnc_findNearestEnemy = { params ["_unit"]; private _enemies = allUnits select { alive _x && (side _x == west || side _x == resistance) && !isPlayer _x }; if (count _enemies == 0) exitWith { objNull }; private _nearest = _enemies select 0; private _minDist = 999999; { if (!isNull _x && alive _x) then { private _dist = _unit distance _x; if (_dist < _minDist) then { _minDist = _dist; _nearest = _x; }; }; } forEach _enemies; _nearest };
fnc_findNearestEnemyPos = { params ["_unit"]; private _enemy = [_unit] call fnc_findNearestEnemy; if (isNull _enemy) exitWith { [0,0,0] }; getPos _enemy };
fnc_checkFriendlyNearby = { params ["_pos","_radius"]; private _f = allUnits select { alive _x && side _x == east && !isPlayer _x && (_x distance _pos) < _radius }; (count _f > 0) };
fnc_hasLineOfSight = { params ["_pos1","_pos2"]; !(lineIntersects [_pos1, _pos2, objNull, objNull, true, 1] || terrainIntersect [_pos1, _pos2]) };
fnc_findSafeRespawnPos = {
params ["_c","_min","_max"]; private _p = []; private _a = 0;
while {_p isEqualTo [] && _a < 50} do { private _t = _c getPos [(_min + random (_max - _min)), random 360]; _t set [2, 0]; private _s = true; if (surfaceIsWater _t) then { _s = false }; private _ne = _t nearEntities ["Man", 50] select { side _x != DYN_PLAYER_SIDE && alive _x }; if (count _ne > 0) then { _s = false }; if (_s) then { _p = _t }; _a = _a + 1; };
if (_p isEqualTo []) then { _p = _c getPos [(_min + 50), random 360] }; _p
};
fnc_clearUnitHandlers = { params ["_u"]; if (isNull _u) exitWith {}; private _me = _u getVariable ["DYN_MAIN_EH_ID", -1]; if (_me != -1) then { _u removeEventHandler ["Killed", _me]; _u setVariable ["DYN_MAIN_EH_ID", -1]; }; private _se = _u getVariable ["DYN_SWITCH_EH_ID", -1]; if (_se != -1) then { _u removeEventHandler ["Killed", _se]; _u setVariable ["DYN_SWITCH_EH_ID", -1]; }; };
fnc_safeDeleteUnit = { params ["_u"]; if (isNull _u) exitWith {}; hideBody _u; sleep 2; if (!isNull _u) then { deleteVehicle _u; }; };
// ================ ОБРАБОТЧИКИ СМЕРТИ ================
fnc_addMainPlayerDeathHandler = {
params ["_u"]; if (isNull _u) exitWith {};
private _existingEH = _u getVariable ["DYN_MAIN_EH_ID", -1]; if (_existingEH != -1) exitWith {};
private _eid = _u addEventHandler ["Killed", {
params ["_u","_k"];
if (!DYN_RESPAWN_ENABLED || DYN_SWITCH_MODE) exitWith {};
["СМЕРТЬ","Игрок погиб",""] call DYN_addEvent;
DYN_PLAYER_DEATH_SIDE = east;
private _loadout = getUnitLoadout _u; private _unitType = typeOf _u; private _deathPos = getPos _u; private _deathDir = getDir _u;
DYN_PLAYER_LOADOUT = _loadout; DYN_PLAYER_UNIT_TYPE = _unitType;
[_u] call fnc_clearUnitHandlers; [_u] spawn fnc_safeDeleteUnit;
[_deathPos, _deathDir, _loadout, _unitType] spawn {
params ["_deathPos","_deathDir","_loadout","_unitType"];
sleep 3;
private _eastUnits = allUnits select { alive _x && side _x == east && !isPlayer _x };
if (count _eastUnits > 0) then {
private _newUnit = selectRandom _eastUnits;
selectPlayer _newUnit; DYN_MAIN_PLAYER = _newUnit; DYN_PLAYER_SIDE = east;
DYN_PLAYER_UNIT_TYPE = typeOf _newUnit; DYN_PLAYER_LOADOUT = getUnitLoadout _newUnit; DYN_MAIN_PLAYER_POS = getPos _newUnit;
[_newUnit] call fnc_addMainPlayerDeathHandler; [_newUnit] call fnc_attachMenuToUnit; [_newUnit] call fnc_addRankDamageHandler;
hint " Возрождение: переключение на юнит Востока!";
} else {
private _spawnPos = [_deathPos, 200, 250] call fnc_findSafeRespawnPos;
if (_spawnPos isEqualTo []) then { _spawnPos = _deathPos getPos [200, random 360]; };
private _grp = createGroup east; private _newUnit = _grp createUnit [_unitType, _spawnPos, [], 0, "NONE"];
_newUnit setDir _deathDir; _newUnit setUnitLoadout _loadout; _newUnit setDamage 0; _newUnit setFatigue 0; _newUnit setVariable ["DYN_SIDE", east, true];
selectPlayer _newUnit; DYN_MAIN_PLAYER = _newUnit; DYN_PLAYER_SIDE = east; DYN_PLAYER_UNIT_TYPE = _unitType; DYN_PLAYER_LOADOUT = _loadout; DYN_MAIN_PLAYER_POS = _spawnPos;
[_newUnit] call fnc_addMainPlayerDeathHandler; [_newUnit] call fnc_attachMenuToUnit; [_newUnit] call fnc_addRankDamageHandler;
hint " Возрождение выполнено (200м от места гибели)!";
};
};
}];
_u setVariable ["DYN_MAIN_EH_ID", _eid];
};
fnc_addSwitchDeathHandler = {
params ["_u"]; if (isNull _u) exitWith {};
private _ee = _u getVariable ["DYN_SWITCH_EH_ID", -1]; if (_ee != -1) exitWith {};
private _eid = _u addEventHandler ["Killed", { params ["_u","_k"]; if (player == _u && DYN_SWITCH_MODE) then { hint "Юнит погиб! Возврат..."; [] spawn { sleep 1; call fnc_returnToMainPlayer; }; }; }];
_u setVariable ["DYN_SWITCH_EH_ID", _eid];
};
// ================ РПГ ================
fnc_createRPGBomber = {
params ["_group", "_pos"];
private _unit = _group createUnit ["O_Soldier_LAT_F", _pos, [], 5 + random 10, "FORM"];
_unit setSkill 0.95; _unit setSkill ["aimingAccuracy", 0.95]; _unit setSkill ["aimingShake", 0.95]; _unit setSkill ["aimingSpeed", 0.95]; _unit setSkill ["spotDistance", 0.95]; _unit setSkill ["spotTime", 0.95]; _unit setSkill ["courage", 1]; _unit setSkill ["commanding", 1];
_unit setUnitPos "AUTO"; _unit allowFleeing 0; _unit setBehaviour "COMBAT"; _unit setCombatMode "RED"; _unit setSpeedMode "FULL";
_unit setVariable ["DYN_SIDE", east, true]; _unit setVariable ["DYN_AI_UNIT", true, true]; _unit setVariable ["DYN_IS_RPG", true, true];
_unit removeWeapon "launch_RPG7_F"; _unit addWeapon "launch_RPG7_F";
for "_i" from 1 to 6 do { _unit addMagazine "RPG7_F"; };
_unit addEventHandler ["Fired", { params ["_u","_weapon"]; if (_weapon == "launch_RPG7_F") then { _u addMagazine "RPG7_F"; }; }];
_unit addMagazine "30Rnd_65x39_caseless_green"; _unit addMagazine "30Rnd_65x39_caseless_green"; _unit addMagazine "HandGrenade"; _unit addMagazine "SmokeShell"; _unit addItem "FirstAidKit";
_unit
};
fnc_aiRPGUsage = { while {DYN_AI_ACTIVE} do { sleep 3; if (!DYN_AI_ACTIVE) exitWith {}; private _rpgUnits = allUnits select { side _x == east && alive _x && !isPlayer _x && _x hasWeapon "launch_RPG7_F" }; { private _unit = _x; private _enemy = [_unit] call fnc_findNearestEnemy; if (!isNull _enemy && alive _enemy) then { private _dist = _unit distance _enemy; if (_dist > 20 && _dist < 600) then { private _rpgAmmo = _unit ammo "launch_RPG7_F"; if (_rpgAmmo > 0) then { _unit selectWeapon "launch_RPG7_F"; _unit reveal [_enemy, 4]; _unit doWatch _enemy; _unit commandTarget _enemy; _unit setBehaviour "COMBAT"; _unit setCombatMode "RED"; sleep 0.5; if (currentWeapon _unit == "launch_RPG7_F") then { _unit fire ["launch_RPG7_F", "launch_RPG7_F", "RPG7_F"]; }; } else { _unit addMagazine "RPG7_F"; }; }; }; } forEach _rpgUnits; }; };
// ================ УСКОРЕНИЯ ================
fnc_toggleQuadbikeBoost = {
if (isNull player) exitWith { hint "Игрок не найден!" };
private _veh = vehicle player; if (_veh == player) exitWith { hint "Сядьте в квадроцикл!" }; if !(_veh isKindOf "Quadbike") exitWith { hint "Это не квадроцикл!" };
DYN_QUADBIKE_BOOST_ACTIVE = !DYN_QUADBIKE_BOOST_ACTIVE;
if (DYN_QUADBIKE_BOOST_ACTIVE) then {
hint " Ускорение ВКЛЮЧЕНО";
if (!isNull DYN_QUADBIKE_BOOST_THREAD) then { terminate DYN_QUADBIKE_BOOST_THREAD; };
DYN_QUADBIKE_BOOST_THREAD = [] spawn { private _targetSpeed = DYN_QUADBIKE_TARGET_SPEED; while {DYN_QUADBIKE_BOOST_ACTIVE} do { if (isNull player || !alive player) exitWith {}; private _veh = vehicle player; if (_veh != player && alive _veh && {_veh isKindOf "Quadbike"}) then { private _dir = getDir _veh; private _vel = velocity _veh; _veh setVelocity [(sin _dir) * _targetSpeed, (cos _dir) * _targetSpeed, _vel select 2]; _veh setFuel 1; if (damage _veh > 0) then { _veh setDamage 0; }; } else { DYN_QUADBIKE_BOOST_ACTIVE = false; hint " Ускорение ВЫКЛЮЧЕНО"; }; sleep 0.02; }; };
} else { if (!isNull DYN_QUADBIKE_BOOST_THREAD) then { terminate DYN_QUADBIKE_BOOST_THREAD; }; hint " Ускорение ВЫКЛЮЧЕНО"; };
};
fnc_toggleDroneBoost = {
DYN_DRONE_BOOST_ACTIVE = !DYN_DRONE_BOOST_ACTIVE;
if (DYN_DRONE_BOOST_ACTIVE) then { hint "Ускорение дрона 600 км/ч ВКЛЮЧЕНО"; if (!isNull DYN_DRONE_BOOST_THREAD) then { terminate DYN_DRONE_BOOST_THREAD; }; DYN_DRONE_BOOST_THREAD = [] spawn { while {DYN_DRONE_BOOST_ACTIVE} do { if (isNull player || !alive player) exitWith {}; private _veh = vehicle player; if (_veh != player && alive _veh) then { private _dir = getDir _veh; private _vel = velocity _veh; _veh setVelocity [(sin _dir) * 166.67, (cos _dir) * 166.67, _vel select 2]; }; sleep 0.1; }; }; } else { if (!isNull DYN_DRONE_BOOST_THREAD) then { terminate DYN_DRONE_BOOST_THREAD; }; hint "Ускорение дрона ВЫКЛЮЧЕНО"; };
};
// ================ АВТОПИЛОТ ================
DRONE_searchAndDestroy = {
if (DRONE_autoPilotActive) exitWith { DRONE_autoPilotActive = false; if (!isNull DYN_MAIN_PLAYER && alive DYN_MAIN_PLAYER) then { selectPlayer DYN_MAIN_PLAYER; DYN_SWITCH_MODE = false; [DYN_MAIN_PLAYER] call fnc_attachMenuToUnit; }; hint " Автопилот дрона ВЫКЛЮЧЕН"; };
private _drone = vehicle player; if (_drone == player) exitWith { hint "Вы не в дроне!" };
missionNamespace setVariable ["DRONE_originalPlayer", DYN_MAIN_PLAYER]; DRONE_autoPilotActive = true; hint " АВТОПИЛОТ ВКЛЮЧЁН"; ["ДРОН","Автопилот активирован",""] call DYN_addEvent;
[_drone] spawn { params ["_drone"]; while {DRONE_autoPilotActive && alive _drone} do { private _enemyPos = [_drone] call fnc_findNearestEnemyPos; private _dist = _drone distance _enemyPos; if (_dist < 2000 && _dist > 5) then { _drone doMove _enemyPos; _drone doWatch _enemyPos; private _dir = _drone getDir _enemyPos; private _speed = 60; if (_dist < 300) then { _speed = 120; }; if (_dist < 150) then { _speed = 200; }; if (_dist < 80) then { _speed = 300; }; private _vertical = 0; if (_dist < 300) then { _vertical = -10; }; if (_dist < 150) then { _vertical = -25; }; if (_dist < 80) then { _vertical = -50; }; _drone setVelocity [(sin _dir) * _speed, (cos _dir) * _speed, _vertical]; if (_dist < 25) then { _drone setPos [_enemyPos select 0, _enemyPos select 1, (_enemyPos select 2) + 1]; "HelicopterExploBig" createVehicle (getPos _drone); private _victims = allUnits select { _x distance _drone < 50 && alive _x && (side _x == west || side _x == resistance) }; { _x setDamage 1 } forEach _victims; private _veh = vehicles select { _x distance _drone < 50 && alive _x && (side _x == west || side _x == resistance) }; { _x setDamage ((damage _x) + 0.
} forEach _veh; if (count crew _drone > 0) then { { deleteVehicle _x } forEach crew _drone; }; deleteVehicle _drone; DRONE_autoPilotActive = false; hint " ДРОН УНИЧТОЖИЛ ЦЕЛЬ!"; if (!isNull DYN_MAIN_PLAYER && alive DYN_MAIN_PLAYER) then { selectPlayer DYN_MAIN_PLAYER; DYN_SWITCH_MODE = false; [DYN_MAIN_PLAYER] call fnc_attachMenuToUnit; }; }; } else { private _patrolPos = (getPos _drone) getPos [300, random 360]; _patrolPos set [2, 100]; _drone doMove _patrolPos; }; sleep 0.05; }; };
};
// ================ АРСЕНАЛ И ПРЕСЕТЫ ================
fnc_openArsenal = { if (isNull player) exitWith { hint "Игрок не найден!" }; if (DYN_ARSENAL_OPEN) exitWith { hint "Арсенал уже открыт!" }; if (DYN_GUI_OPEN) then { call fnc_closeMainMenu; }; DYN_ARSENAL_OPEN = true; hint "Открываю арсенал..."; ["Open", true] call BIS_fnc_arsenal; [] spawn { sleep 2; waitUntil { sleep 0.5; private _ad = uiNamespace getVariable ["BIS_fnc_arsenal_display", displayNull]; isNull _ad }; sleep 0.5; DYN_ARSENAL_OPEN = false; }; };
fnc_applyPresetLoadout = {
params ["_presetName"]; if (isNull player) exitWith { hint "Игрок не найден!" }; if (DYN_ARSENAL_OPEN) exitWith { hint "Закройте арсенал!" };
removeAllWeapons player; removeAllItems player; removeAllAssignedItems player; removeUniform player; removeVest player; removeBackpack player; removeHeadgear player; removeGoggles player;
switch (_presetName) do {
case "MACHINEGUNNER": { player forceAddUniform "U_O_CombatUniform_ocamo"; player addVest "V_PlateCarrier1_blk"; player addBackpack "B_FieldPack_ocamo"; player addWeapon "LMG_Mk200_F"; player addPrimaryWeaponItem "optic_DMS"; player addPrimaryWeaponItem "bipod_01_F_blk"; player addPrimaryWeaponItem "muzzle_snds_H"; for "_i" from 1 to 3 do { player addMagazine "200Rnd_65x39_cased_Box"; }; player addWeapon "launch_RPG7_F"; for "_i" from 1 to 4 do { player addMagazine "RPG7_F"; }; for "_i" from 1 to 4 do { player addMagazine "HandGrenade"; }; for "_i" from 1 to 2 do { player addMagazine "SmokeShell"; }; for "_i" from 1 to 4 do { player addItem "FirstAidKit"; }; player linkItem "ItemGPS"; player linkItem "ItemMap"; player linkItem "ItemCompass"; player linkItem "ItemWatch"; player linkItem "NVGoggles"; player addWeapon "hgun_Rook40_F"; for "_i" from 1 to 2 do { player addMagazine "16Rnd_9x21_Mag"; }; player addHeadgear "O_HelmetCrew_B"; };
case "SNIPER": { player forceAddUniform "U_O_GhillieSuit"; player addVest "V_PlateCarrier1_blk"; player addBackpack "B_FieldPack_ocamo"; player addWeapon "srifle_GM6_F"; player addPrimaryWeaponItem "optic_LRPS"; for "_i" from 1 to 12 do { player addMagazine "5Rnd_127x108_Mag"; }; player addWeapon "launch_RPG7_F"; for "_i" from 1 to 4 do { player addMagazine "RPG7_F"; }; for "_i" from 1 to 4 do { player addMagazine "HandGrenade"; }; for "_i" from 1 to 2 do { player addMagazine "SmokeShell"; }; for "_i" from 1 to 4 do { player addItem "FirstAidKit"; }; player linkItem "ItemGPS"; player linkItem "ItemMap"; player linkItem "ItemCompass"; player linkItem "ItemWatch"; player linkItem "NVGoggles"; player addWeapon "hgun_Rook40_F"; for "_i" from 1 to 2 do { player addMagazine "16Rnd_9x21_Mag"; }; player addHeadgear "O_HelmetCrew_B"; };
case "STEALTH": { player forceAddUniform "U_O_SpecopsUniform_ocamo"; player addVest "V_PlateCarrier1_blk"; player addBackpack "B_FieldPack_ocamo"; player addWeapon "arifle_Katiba_F"; player addPrimaryWeaponItem "optic_Hamr"; player addPrimaryWeaponItem "muzzle_snds_H"; for "_i" from 1 to 8 do { player addMagazine "30Rnd_65x39_caseless_green"; }; player addWeapon "launch_RPG7_F"; for "_i" from 1 to 4 do { player addMagazine "RPG7_F"; }; for "_i" from 1 to 4 do { player addMagazine "HandGrenade"; }; for "_i" from 1 to 2 do { player addMagazine "SmokeShell"; }; for "_i" from 1 to 4 do { player addItem "FirstAidKit"; }; player linkItem "ItemGPS"; player linkItem "ItemMap"; player linkItem "ItemCompass"; player linkItem "ItemWatch"; player linkItem "NVGoggles"; player addWeapon "hgun_Pistol_heavy_02_F"; for "_i" from 1 to 2 do { player addMagazine "6Rnd_45ACP_Cylinder"; }; player addHeadgear "O_HelmetCrew_B"; };
};
call fnc_closeMainMenu;
};
// ================ УДАРЫ И БОЕПРИПАСЫ ================
fnc_callSmartMissileStrike = { if (DYN_ARSENAL_OPEN) exitWith { hint "Закройте арсенал!" }; systemChat " УМНАЯ РАКЕТА: откройте карту"; call fnc_closeMainMenu; openMap [true, true]; waitUntil { !isNull (findDisplay 12) }; private _eh = addMissionEventHandler ["MapSingleClick", { params ["_units","_pos","_alt","_shift"]; ["УДАР","Умная ракета по карте",""] call DYN_addEvent; [_pos] spawn { params ["_pos"]; "M_Mo_82mm_AT_LG" createVehicle _pos; sleep 0.5; private _vh = vehicles select { _x distance _pos < 1000 && alive _x && (side _x == west || side _x == resistance) }; { _x setDamage 1; } forEach _vh; }; removeMissionEventHandler ["MapSingleClick", _thisEventHandler]; openMap [false, false]; }]; };
fnc_aviationRocketStrikeAtMap = { if (DYN_ARSENAL_OPEN) exitWith { hint "Закройте арсенал!" }; systemChat " АВИА РАКЕТА: откройте карту"; call fnc_closeMainMenu; openMap [true, true]; waitUntil { !isNull (findDisplay 12) }; private _eh = addMissionEventHandler ["MapSingleClick", { params ["_units","_pos","_alt","_shift"]; ["УДАР","Авиационная ракета по карте",""] call DYN_addEvent; [_pos] spawn { params ["_pos"]; "Rocket_04_HE_F" createVehicle _pos; }; removeMissionEventHandler ["MapSingleClick", _thisEventHandler]; openMap [false, false]; }]; };
fnc_refillAmmo = { if (isNull player || DYN_ARSENAL_OPEN) exitWith { hint "Закройте арсенал!" }; player setVehicleAmmo 1; player setVehicleAmmoDef 1; { player addMagazine _x; } forEach (getArray (configFile >> "CfgWeapons" >> (currentWeapon player) >> "magazines")); hint "Боеприпасы пополнены!"; call fnc_closeMainMenu; };
fnc_saveLoadout = { params ["_slot"]; if (isNull player || DYN_ARSENAL_OPEN) exitWith {}; private _loadout = getUnitLoadout player; DYN_LOADOUTS set [_slot - 1, _loadout]; profileNamespace setVariable [format ["DYN_LOADOUT_%1", _slot], _loadout]; saveProfileNamespace; hint format ["Набор %1 сохранён!", _slot]; call fnc_closeMainMenu; };
fnc_loadLoadout = { params ["_slot"]; if (isNull player || DYN_ARSENAL_OPEN) exitWith {}; private _loadout = profileNamespace getVariable [format ["DYN_LOADOUT_%1", _slot], []]; if (isNil "_loadout" || {count _loadout == 0}) exitWith { hint format ["Набор %1 пуст!", _slot]; }; player setUnitLoadout _loadout; hint format ["Набор %1 загружен!", _slot]; call fnc_closeMainMenu; };
fnc_deleteLoadout = { params ["_slot"]; if (DYN_ARSENAL_OPEN) exitWith {}; DYN_LOADOUTS set [_slot - 1, []]; profileNamespace setVariable [format ["DYN_LOADOUT_%1", _slot], []]; saveProfileNamespace; hint format ["Набор %1 удалён!", _slot]; call fnc_closeMainMenu; };
// ================ ТЕЛЕПОРТ ================
fnc_teleportPlayer = { if (DYN_ARSENAL_OPEN) exitWith { hint "Закройте арсенал!" }; systemChat "ТЕЛЕПОРТ: откройте карту"; call fnc_closeMainMenu; openMap [true, true]; waitUntil { !isNull (findDisplay 12) }; private _eh = addMissionEventHandler ["MapSingleClick", { params ["_units","_pos","_alt","_shift"]; player setPos [_pos#0, _pos#1, 0]; DYN_MAIN_PLAYER_POS = getPos player; removeMissionEventHandler ["MapSingleClick", _thisEventHandler]; openMap [false, false]; }]; };
fnc_joinAllEastToPlayer = { if (DYN_ARSENAL_OPEN) exitWith { hint "Закройте арсенал!" }; private _pg = group player; private _cnt = 0; { if (side _x == east && alive _x && _x != player && !isPlayer _x && group _x != _pg) then { [_x] joinSilent _pg; _cnt = _cnt + 1; }; } forEach (allUnits select {true}); _pg setBehaviour "AWARE"; _pg setCombatMode "YELLOW"; hint format ["Присоединено: %1 юнитов", _cnt]; call fnc_closeMainMenu; };
fnc_teleportAllEastToMapPoint = { if (DYN_ARSENAL_OPEN) exitWith { hint "Закройте арсенал!" }; systemChat "ТЕЛЕПОРТ ВОСТОЧНЫХ: откройте карту"; call fnc_closeMainMenu; openMap [true, true]; waitUntil { !isNull (findDisplay 12) }; private _eh = addMissionEventHandler ["MapSingleClick", { params ["_units","_pos","_alt","_shift"]; private _ic = 0; private _vc = 0; private _ac = 0; { if (vehicle _x == _x) then { private _tp = (_pos getPos [10 + random 30, random 360]); _tp set [2, 0]; if (!surfaceIsWater _tp) then { _x setPos _tp; _ic = _ic + 1; }; }; } forEach (allUnits select { side _x == east && alive _x && !isPlayer _x }); { private _tp = (_pos getPos [40 + random 60, random 360]); _tp set [2, 0]; if (!surfaceIsWater _tp) then { _x setPos _tp; _x setDir random 360; _x setFuel 1; _x setDamage 0; _x setVehicleAmmo 1; _vc = _vc + 1; }; } forEach (vehicles select { alive _x && side _x == east && !(_x isKindOf "Air") && !(_x isKindOf "Quadbike") }); { private _tp = (_pos getPos [50 + random 80, random 360]); _tp set [2, 100 + random 100]; _x setPos _tp; _x setDir random 360; _x setFuel 1; _x setDamage 0; _x setVehicleAmmo 1; if (_x isKindOf "Plane") then { _x flyInHeight 200; } else { _x flyInHeight 100; }; _ac = _ac + 1; } forEach (vehicles select { alive _x && side _x == east && _x isKindOf "Air" }); hint format ["ТЕЛЕПОРТ! Пехота: %1 Техника: %2 Авиация: %3", _ic, _vc, _ac]; removeMissionEventHandler ["MapSingleClick", _thisEventHandler]; openMap [false, false]; }]; };
// ================ ДРОНЫ ================
DRONE_setAltitude = { params ["_alt"]; droneSpawnAltitude = _alt; hint format ["Высота: %1 м", _alt]; };
DRONE_returnToPlayer = { private _player = missionNamespace getVariable ["DRONE_originalPlayer", objNull]; if (!isNull _player && {alive _player}) then { if (player != _player) then { selectPlayer _player; DYN_SWITCH_MODE = false; DRONE_autoPilotActive = false; GZ_isControllingDrone = false; GZ_isControllingPlane = false; GZ_isControllingMegaDrone = false; [_player] call fnc_attachMenuToUnit; hint "Вы вернулись!"; }; } else { hint "Игрок не найден!"; }; call fnc_closeMainMenu; };
DRONE_deleteAllDrones = { private _player = missionNamespace getVariable ["DRONE_originalPlayer", objNull]; if (!isNull _player && {alive _player} && {player != _player}) then { selectPlayer _player; DYN_SWITCH_MODE = false; DRONE_autoPilotActive = false; GZ_isControllingDrone = false; GZ_isControllingPlane = false; GZ_isControllingMegaDrone = false; [_player] call fnc_attachMenuToUnit; }; { if (!isNull _x) then { { if (!isNull _x) then { deleteVehicle _x; }; } forEach crew _x; deleteVehicle _x; }; } forEach DRONE_allSpawnedDrones; DRONE_allSpawnedDrones = []; hint "Все дроны удалены!"; call fnc_closeMainMenu; };
DRONE_spawnStandardDrone = {
params ["_player","_className"];
if (GZ_isControllingDrone || GZ_isControllingPlane || GZ_isControllingMegaDrone) exitWith { hint "Уже управляете другой техникой!" };
GZ_isControllingDrone = true;
private _isGround = _className in DRONE_GROUND_CLASSES;
missionNamespace setVariable ["DRONE_originalPlayer", _player];
private _sp = _player getPos [50, getDir _player]; private _drone = objNull;
if (!_isGround) then { _sp set [2, droneSpawnAltitude]; _drone = createVehicle [_className, _sp, [], 0, "FLY"]; createVehicleCrew _drone; _drone flyInHeight droneSpawnAltitude; } else { _drone = createVehicle [_className, _sp, [], 0, "CAN_COLLIDE"]; createVehicleCrew _drone; };
private _op = driver _drone; _drone setOwner owner _op; if (player != _op) then { selectPlayer _op; };
DRONE_allSpawnedDrones pushBack _drone;
_drone addEventHandler ["Fired", { params ["_vehicle"]; _vehicle setVehicleAmmo 1; }];
_drone addEventHandler ["Killed", { [] spawn { sleep 1; private _player = missionNamespace getVariable ["DRONE_originalPlayer", objNull]; if (!isNull _player && alive _player) then { selectPlayer _player; DYN_SWITCH_MODE = false; DRONE_autoPilotActive = false; DYN_DRONE_BOOST_ACTIVE = false; GZ_isControllingDrone = false; [_player] call fnc_attachMenuToUnit; }; }; }];
private _op = driver _drone; _op addEventHandler ["Killed", { [] spawn { sleep 1; private _player = missionNamespace getVariable ["DRONE_originalPlayer", objNull]; if (!isNull _player && alive _player) then { selectPlayer _player; DYN_SWITCH_MODE = false; DRONE_autoPilotActive = false; DYN_DRONE_BOOST_ACTIVE = false; GZ_isControllingDrone = false; [_player] call fnc_attachMenuToUnit; }; }; }];
[_drone] spawn { params ["_d"]; while { alive _d } do { if (fuel _d < 0.
then { _d setFuel 1; }; sleep 5; }; };
if (isNull DYN_MAIN_PLAYER) then { DYN_MAIN_PLAYER = _player; DYN_PLAYER_SIDE = side _player; DYN_PLAYER_UNIT_TYPE = typeOf _player; DYN_PLAYER_LOADOUT = getUnitLoadout _player; DYN_MAIN_PLAYER_POS = getPos _player; };
DYN_SWITCH_MODE = true; [_op] call fnc_attachMenuToUnit; [_op] call fnc_addSwitchDeathHandler;
hint format ["Дрон %1 активирован", getText (configFile >> "CfgVehicles" >> _className >> "displayName")]; call fnc_closeMainMenu;
};
// ============================================================
// НОВОЕ v19.19: ТАКТИЧЕСКИЕ СИСТЕМЫ (САУ, Штурмовик, Мегадрон, Спецназ, ПВО)
// ============================================================
GZ_deleteVehicleWithCrew = { params ["_vehicle"]; if (!isNull _vehicle) then { { if (!isNull _x) then { deleteVehicle _x } } forEach crew _vehicle; deleteVehicle _vehicle; }; };
GZ_getUniqueMarkerName = { private _name = "GZ_mrk_" + str GZ_markerCounter; GZ_markerCounter = GZ_markerCounter + 1; _name };
// Базовая экипировка (из тактического скрипта)
fnc_equipStandardLoadout = {
params ["_player"]; if (isNull _player) exitWith {};
removeAllWeapons _player; removeAllItems _player; removeAllAssignedItems _player; removeUniform _player; removeVest _player; removeBackpack _player; removeHeadgear _player; removeGoggles _player;
_player forceAddUniform "U_O_CombatUniform_ocamo"; _player addVest "V_TacVest_brn"; _player addHeadgear "H_HelmetSpecO_ocamo"; _player addBackpack "B_Carryall_ocamo";
_player addWeapon "arifle_CTAR_blk_F"; _player addPrimaryWeaponItem "optic_DMS"; _player addPrimaryWeaponItem "muzzle_snds_58_black_F";
_player addWeapon "launch_RPG7_F"; for "_i" from 1 to 3 do { _player addItemToBackpack "RPG7_F"; };
for "_i" from 1 to 6 do { _player addItemToVest "30Rnd_580x42_Mag_F"; _player addItemToBackpack "30Rnd_580x42_Mag_Tracer_F"; };
for "_i" from 1 to 4 do { _player addItemToVest "MiniGrenade"; }; for "_i" from 1 to 6 do { _player addItemToBackpack "SmokeShell"; };
for "_i" from 1 to 10 do { _player addItemToBackpack "FirstAidKit"; };
_player linkItem "ItemMap"; _player linkItem "ItemCompass"; _player linkItem "ItemWatch"; _player linkItem "ItemGPS"; _player linkItem "NVGoggles";
hint "Стандартная экипировка выдана!"; call fnc_closeMainMenu;
};
// САУ (Артиллерия)
fnc_spawnArtillery = {
{ [_x] call GZ_deleteVehicleWithCrew } forEach artilleryUnits; artilleryUnits = [];
if (isNull artilleryGroup) then { artilleryGroup = createGroup east; };
private _playerPos = getPos player; private _safePos = []; private _found = false;
for "_i" from 0 to 75 do {
private _testPos = _playerPos getPos [2800 + random 800, random 360]; _testPos = [_testPos select 0, _testPos select 1, 0];
private _isValid = true;
if (surfaceIsWater _testPos) then { _isValid = false };
private _nearObjects = nearestTerrainObjects [_testPos, ["TREE", "HOUSE", "FENCE", "WALL", "ROCK"], 30];
if (count _nearObjects > 2) then { _isValid = false };
private _centerHeight = getTerrainHeightASL _testPos; private _maxDiff = 0;
for "_d" from 0 to 270 step 90 do { private _sidePos = _testPos getPos [15, _d]; private _height = getTerrainHeightASL _sidePos; private _diff = abs(_centerHeight - _height); if (_diff > _maxDiff) then {_maxDiff = _diff}; };
if (_maxDiff > 1.0) then { _isValid = false };
if (!_isValid) then { continue };
private _emptyPos = _testPos findEmptyPosition [7, 70, "O_MBT_02_arty_F"];
if (count _emptyPos == 0) then { continue };
private _nearEnemies = allUnits findIf { side _x == west && _x distance _emptyPos < 3000 } > -1;
if (_nearEnemies) then { continue };
_safePos = _emptyPos; _found = true; break;
};
if (!_found) then { _safePos = _playerPos getPos [1500, random 360]; _safePos = _safePos findEmptyPosition [0, 40, "O_MBT_02_arty_F"]; if (count _safePos == 0) then { _safePos = _playerPos getPos [1500, random 360] }; };
private _vehicle = createVehicle ["O_MBT_02_arty_F", _safePos, [], 0, "NONE"];
_vehicle setDir (random 360); _vehicle setVectorUp surfaceNormal _safePos;
artilleryUnits = [_vehicle];
private _gunner = artilleryGroup createUnit ["O_crew_F", _safePos, [], 0, "NONE"]; _gunner moveInGunner _vehicle;
private _commander = artilleryGroup createUnit ["O_crew_F", _safePos, [], 0, "NONE"]; _commander moveInCommander _vehicle;
_vehicle setVehicleAmmo 1; _vehicle addEventHandler ["Fired", { (_this select 0) setVehicleAmmo 1; }];
[_vehicle] spawn {
params ["_vehicle"];
while {alive _vehicle} do {
private _targets = vehicles select { alive _x && side _x == west && !(_x isKindOf "Air") && _vehicle distance _x > 1200 };
if (count _targets == 0) then { _targets = allUnits select { alive _x && side _x == west && _vehicle distance _x > 500 }; };
if (count _targets > 0) then {
private _targetsCopy = +_targets; private _numTargets = if (count _targetsCopy >= 2) then { 2 } else { 1 };
for "_i" from 1 to _numTargets do {
private _index = floor random (count _targetsCopy); private _target = _targetsCopy select _index;
private _targetPos = (getPos _target) getPos [random 35, random 360];
_vehicle commandArtilleryFire [_targetPos, "32Rnd_155mm_Mo_shells_O", 2];
_targetsCopy = _targetsCopy - [_target]; sleep 0.2;
};
};
sleep 10;
};
};
hint parseText format ["<t size='1.4' color='#FFA500'>АРТИЛЛЕРИЯ РАЗВЁРНУТА</t><br/>Сектор: %1<br/>Удаление: %2 метров", mapGridPosition _safePos, round(_playerPos distance _safePos)];
call fnc_closeMainMenu;
};
// Спецотряд (Умный)
fnc_spawnSpecOpsSquad = {
private _specOpsGroup = missionNamespace getVariable ["specOpsGroup", grpNull];
if (!isNull _specOpsGroup) then { { deleteVehicle _x } forEach units _specOpsGroup; deleteGroup _specOpsGroup; };
private _playerPos = getPos player; private _group = createGroup [east, true];
missionNamespace setVariable ["specOpsGroup", _group];
private _weapons = [["srifle_DMR_02_F", "10Rnd_338_Mag"],["arifle_RPK12_F", "75rnd_762x39_AK12_Mag_F"],["arifle_AK12_GL_F", "30Rnd_762x39_AK12_Mag_F"]];
for "_i" from 0 to 9 do {
private _spawnPos = _playerPos getPos [10 + random 10, random 360];
_spawnPos = _spawnPos findEmptyPosition [0, 10, "O_Soldier_F"];
if (count _spawnPos == 0) then { _spawnPos = _playerPos getPos [10 + random 10, random 360] };
private _unit = _group createUnit [selectRandom ["O_Soldier_F", "O_recon_F", "O_V_Soldier_Exp_hex_F"], _spawnPos, [], 0, "NONE"];
_unit setSkill 1; _unit allowFleeing 0;
removeAllWeapons _unit; removeAllItems _unit; removeAllAssignedItems _unit; removeUniform _unit; removeVest _unit; removeBackpack _unit; removeHeadgear _unit; removeGoggles _unit;
_unit forceAddUniform "U_O_V_Soldier_Viper_F"; _unit addVest "V_PlateCarrierSpec_rgr"; _unit addHeadgear "H_HelmetAggressor_F"; _unit addGoggles "G_Balaclava_oli"; _unit addBackpack "B_Carryall_ocamo";
private _weaponType = switch true do { case (_i == 0 || _i == 1): { _weapons select 0 }; case (_i == 2 || _i == 3): { _weapons select 1 }; default { _weapons select 2 }; };
_unit addWeapon (_weaponType select 0); _unit addPrimaryWeaponItem "muzzle_snds_B"; _unit addPrimaryWeaponItem "optic_LRPS";
if (_i >= 4) then { _unit addWeapon "launch_RPG7_F"; for "_j" from 1 to 3 do { _unit addItemToBackpack "RPG7_F"; }; };
for "_j" from 1 to 8 do { _unit addItemToVest (_weaponType select 1); };
for "_j" from 1 to 5 do { _unit addItemToVest "MiniGrenade"; _unit addItemToVest "SmokeShell"; };
for "_j" from 1 to 10 do { _unit addItemToBackpack "FirstAidKit"; };
_unit linkItem "NVGoggles"; _unit linkItem "ItemGPS"; _unit enableStamina false;
};
_group setCombatMode "RED"; _group setBehaviour "STEALTH";
[] spawn {
private _group = missionNamespace getVariable ["specOpsGroup", grpNull];
if (isNull _group) exitWith {};
while { count units _group > 0 } do {
private _enemies = allUnits select { alive _x && side _x == west && {leader _group distance _x < 1500} };
if (count _enemies > 0) then {
{ if (_group knowsAbout _x < 4) then { _group reveal [_x, 4]; };
private _attackPos = getPos _x;
while {count waypoints _group > 0} do { deleteWaypoint [_group, 0] };
private _wp = _group addWaypoint [_attackPos, 25]; _wp setWaypointType "SAD"; _wp setWaypointCompletionRadius 20; _wp setWaypointTimeout [5, 10, 15];
if (_x isKindOf "Tank" || _x isKindOf "Car") then { private _enemy = _x; { if ("launch_RPG7_F" in weapons _x) then { _x doTarget _enemy; _x doFire _enemy; }; } forEach units _group; };
uiSleep 0.3; } forEach _enemies;
} else {
while {count waypoints _group > 0} do { deleteWaypoint [_group, 0] };
private _wp = _group addWaypoint [position player, 100]; _wp setWaypointType "SENTRY"; _wp setWaypointCompletionRadius 50;
};
uiSleep 30;
};
};
hint "СПЕЦОТРЯД АКТИВИРОВАН! 10 профессиональных бойцов ищут врагов"; call fnc_closeMainMenu;
};
// Элитный спецназ (присоединяется к группе)
fnc_spawnSupportGroup = {
if (count supportUnits > 0) then { { deleteVehicle _x } forEach supportUnits; supportUnits = []; };
private _centerPos = player getPos [15, getDir player]; private _playerGroup = group player;
for "_i" from 0 to 9 do {
private _pos = _centerPos getPos [10, _i * 36];
private _safePos = _pos findEmptyPosition [0, 5, "O_Soldier_F"];
if (count _safePos == 0) then {_safePos = _pos};
private _unit = _playerGroup createUnit [selectRandom playerReinforcementInfantry, _safePos, [], 0, "NONE"];
removeAllWeapons _unit; removeAllItems _unit; removeAllAssignedItems _unit; removeUniform _unit; removeVest _unit; removeBackpack _unit; removeHeadgear _unit; removeGoggles _unit;
_unit forceAddUniform "U_O_V_Soldier_Viper_F"; _unit addVest "V_PlateCarrierSpec_rgr"; _unit addHeadgear "H_HelmetLeaderO_ocamo"; _unit addGoggles "G_Balaclava_oli"; _unit addBackpack "B_Carryall_ocamo";
_unit addWeapon "arifle_CTARS_blk_F"; _unit addPrimaryWeaponItem "optic_Nightstalker"; _unit addPrimaryWeaponItem "muzzle_snds_58_black_F";
_unit addWeapon "launch_RPG7_F";
for "_j" from 1 to 8 do { _unit addItemToVest "100Rnd_580x42_Mag_F"; _unit addItemToBackpack "100Rnd_580x42_Mag_Tracer_F"; };
for "_j" from 1 to 3 do { _unit addItemToBackpack "RPG7_F"; };
for "_j" from 1 to 8 do { _unit addItemToVest "MiniGrenade"; };
for "_j" from 1 to 10 do { _unit addItemToBackpack "SmokeShell"; };
for "_j" from 1 to 5 do { _unit addItemToBackpack "SmokeShellRed"; };
for "_j" from 1 to 12 do { _unit addItemToBackpack "FirstAidKit"; };
_unit linkItem "ItemMap"; _unit linkItem "ItemCompass"; _unit linkItem "ItemWatch"; _unit linkItem "NVGoggles"; _unit linkItem "ItemGPS";
_unit setSkill ["aimingAccuracy", 1]; _unit setSkill ["aimingShake", 1]; _unit setSkill ["courage", 1]; _unit enableStamina false;
_unit addEventHandler ["HandleDamage", { _damage = _this select 2; _damage * 0.5 }];
supportUnits pushBack _unit; uiSleep 0.1;
};
_playerGroup setCombatMode "RED"; _playerGroup setBehaviour "COMBAT";
hint "ЭЛИТНОЕ ПОДРАЗДЕЛЕНИЕ ПРИБЫЛО! 10 бойцов присоединились к вам"; call fnc_closeMainMenu;
};
// Мегадрон (с кассетной боевой частью)
fnc_spawnFuturisticDrone = {
if (GZ_isControllingDrone || GZ_isControllingPlane || GZ_isControllingMegaDrone) exitWith { hint "Уже управляете другой техникой!" };
GZ_isControllingMegaDrone = true;
private _originalPlayer = player; missionNamespace setVariable ["DRONE_mainPlayer", _originalPlayer];
private _spawnPos = _originalPlayer modelToWorld [0, 300, MEGA_DRONE_ALT]; _spawnPos set [2, MEGA_DRONE_ALT];
private _drone = createVehicle [MEGA_DRONE_CLASS, _spawnPos, [], 0, "FLY"];
createVehicleCrew _drone; _drone setDir (getDir _originalPlayer); _drone flyInHeight MEGA_DRONE_ALT; _drone engineOn true;
_drone setVelocity (vectorDir _drone vectorMultiply (300 / 3.6));
missionNamespace setVariable ["DRONE_currentVehicle", _drone];
private _operator = driver _drone;
_drone addEventHandler ["Killed", {
params ["_vehicle"];
private _player = missionNamespace getVariable ["DRONE_originalPlayer", objNull];
GZ_isControllingMegaDrone = false;
if (!isNull _player && {alive _player}) then { selectPlayer _player; { deleteMarkerLocal _x } forEach allDroneMarkers; };
private _pos = getPos _vehicle;
"Bo_GBU12_LGB" createVehicle _pos; "M_Mo_82mm_AT" createVehicle _pos;
for "_i" from 1 to MEGA_EXPLOSIONS_COUNT do {
private _expPos = _pos getPos [random 250, random 360]; _expPos set [2, (_pos select 2) + (-20 + random 40)];
private _grenade = "G_40mm_HE" createVehicle _expPos;
_grenade setVelocity [random 25 - 12.5, random 25 - 12.5, -20 - random 30];
if (_i % 10 == 0) then { uiSleep 0.01 };
};
hint parseText format ["<t size='1.4' color='#FF0000'>МЕГАДРОН УНИЧТОЖЕН!</t><br/><t>Кассетная БЧ: %1 суббоеприпасов</t>", MEGA_EXPLOSIONS_COUNT];
}];
selectPlayer _operator; _operator linkItem "ItemGPS"; _operator linkItem "ItemCompass";
[] spawn {
private _drone = missionNamespace getVariable ["DRONE_currentVehicle", objNull];
while {alive _drone && {player == driver _drone}} do {
{ deleteMarkerLocal _x } forEach allDroneMarkers; allDroneMarkers = [];
private _enemies = allUnits select { alive _x && side _x == west && _drone distance _x < 4000 };
{ private _pos = getPos _x; if (count _pos >= 3) then {
private _mark = createMarkerLocal [call GZ_getUniqueMarkerName, _pos];
if (_x isKindOf "Man") then { _mark setMarkerTypeLocal "b_inf"; _mark setMarkerColorLocal "ColorBLUFOR"; } else { _mark setMarkerTypeLocal "b_armor"; _mark setMarkerColorLocal "ColorRED"; };
_mark setMarkerSizeLocal [0.6, 0.6]; allDroneMarkers pushBack _mark; }; } forEach _enemies;
uiSleep 3;
};
{ deleteMarkerLocal _x } forEach allDroneMarkers;
};
_operator addAction ["<t size='1.4' color='#55FF55'>> ВЕРНУТЬ УПРАВЛЕНИЕ ИГРОКУ</t>", {
private _player = missionNamespace getVariable ["DRONE_mainPlayer", objNull];
if (!isNull _player && alive _player) then { GZ_isControllingMegaDrone = false; selectPlayer _player; deleteVehicle vehicle player; };
}, nil, 10, true, true];
hint parseText format ["<t size='1.8' color='#00FF00'>ТЯЖЕЛЫЙ УДАРНЫЙ ДРОН АКТИВИРОВАН</t><br/>Суббоеприпасы: %1<br/>Радиус: 250 м", MEGA_EXPLOSIONS_COUNT];
call fnc_closeMainMenu;
};
// Штурмовик
fnc_spawnAttackPlane = {
if (GZ_isControllingDrone || GZ_isControllingPlane || GZ_isControllingMegaDrone) exitWith { hint "Уже управляете другой техникой!" };
GZ_isControllingPlane = true;
private _spawnPos = player modelToWorld [0, 500, ATTACK_PLANE_ALT]; _spawnPos set [2, ATTACK_PLANE_ALT];
private _plane = createVehicle [ATTACK_PLANE_CLASS, _spawnPos, [], 0, "FLY"];
createVehicleCrew _plane; _plane setDir (getDir player); _plane setVectorUp [0,0,1];
_plane setVelocity (vectorDir _plane vectorMultiply ATTACK_PLANE_START_SPEED);
_plane flyInHeight ATTACK_PLANE_ALT; _plane engineOn true;
_plane removeWeapon "missiles_SCALPEL"; _plane addWeapon "rockets_Skyfire";
for "_i" from 1 to 3 do { _plane addMagazine "38Rnd_80mm_rockets"; };
missionNamespace setVariable ["DRONE_currentVehicle", _plane];
missionNamespace setVariable ["DRONE_mainPlayer", player];
private _operator = driver _plane; selectPlayer _operator; _operator linkItem "ItemGPS";
_operator addAction ["<t size='1.4' color='#55FF55'>> ВЕРНУТЬ УПРАВЛЕНИЕ ИГРОКУ</t>", {
private _player = missionNamespace getVariable ["DRONE_mainPlayer", objNull];
if (!isNull _player && alive _player) then { GZ_isControllingPlane = false; selectPlayer _player; deleteVehicle vehicle player; };
}, nil, 10, true, true];
_plane addEventHandler ["Killed", { GZ_isControllingPlane = false; private _player = missionNamespace getVariable ["DRONE_mainPlayer", objNull]; if (!isNull _player && alive _player) then { selectPlayer _player; { deleteMarkerLocal _x } forEach allDroneMarkers; }; }];
[] spawn {
private _plane = missionNamespace getVariable ["DRONE_currentVehicle", objNull];
while {alive _plane && {player == driver _plane}} do {
{ deleteMarkerLocal _x } forEach allDroneMarkers; allDroneMarkers = [];
private _enemies = allUnits select { alive _x && side _x == west && _plane distance _x < 5000 };
{ private _pos = getPos _x; if (count _pos >= 3) then {
private _mark = createMarkerLocal [call GZ_getUniqueMarkerName, _pos];
if (_x isKindOf "Man") then { _mark setMarkerTypeLocal "b_inf"; _mark setMarkerColorLocal "ColorBLUFOR"; } else { _mark setMarkerTypeLocal "b_armor"; _mark setMarkerColorLocal "ColorRED"; };
_mark setMarkerSizeLocal [0.7, 0.7]; allDroneMarkers pushBack _mark; }; } forEach _enemies;
uiSleep 3; };
{ deleteMarkerLocal _x } forEach allDroneMarkers;
};
hint parseText format ["<t size='1.8' color='#00FF00'>ШТУРМОВИК АКТИВИРОВАН</t><br/>Вооружение: 114 НАР С-8"];
call fnc_closeMainMenu;
};
// ПВО Шилка
fnc_spawnAAVehicle = {
private _spawnPos = player getPos [25, getDir player];
private _aaVehicle = createVehicle ["O_APC_Tracked_02_AA_F", _spawnPos, [], 0, "NONE"];
_aaVehicle setDir (getDir player); createVehicleCrew _aaVehicle; (crew _aaVehicle) join (group player);
hint "ЗСУ 'Шилка' прибыла с экипажем! Система ПВО активирована"; call fnc_closeMainMenu;
};
// AGS-30
fnc_spawnAGSCannon = {
private _spawnPos = player modelToWorld [0, 3, 0];
private _ags = "CUP_O_AGS_ChDKZ" createVehicle _spawnPos;
_ags setDir (getDir player); _ags setVectorUp surfaceNormal position _ags;
_ags addAction ["Управление", {(_this select 1) moveInGunner (_this select 0)}];
hint "AGS установлена на позиции"; call fnc_closeMainMenu;
};
// Миномёт
fnc_spawnMortar = {
private _spawnPos = player getPos [15, getDir player + 180];
private _mortar = "rhsgref_ins_2b14" createVehicle _spawnPos;
_mortar setDir (getDir player);
_mortar addAction ["Занять миномет", {(_this select 1) moveInGunner (_this select 0)}];
hint "Миномёт установлен"; call fnc_closeMainMenu;
};
// Глобальный радар (на карте)
fnc_toggleGlobalRadar = {
radarActive = !radarActive;
if (radarActive) then {
hint "Глобальный радар активирован";
if (!isNull GZ_RADAR_THREAD) then { terminate GZ_RADAR_THREAD; };
GZ_RADAR_THREAD = [] spawn {
private _markers = [];
while {radarActive && alive player} do {
{ deleteMarkerLocal _x } forEach _markers; _markers = [];
private _allTargets = (allUnits + vehicles) select { alive _x && side _x == west && player distance _x < 3000 };
{ private _pos = getPos _x; if (count _pos >= 3) then {
private _marker = createMarkerLocal [call GZ_getUniqueMarkerName, _pos]; _marker setMarkerShapeLocal "ICON";
if (_x isKindOf "Man") then { _marker setMarkerTypeLocal "b_inf"; _marker setMarkerColorLocal "ColorBLUFOR"; } else { _marker setMarkerTypeLocal "b_armor"; _marker setMarkerColorLocal "ColorRED"; };
_marker setMarkerSizeLocal [0.5, 0.5]; _markers pushBack _marker; }; } forEach _allTargets;
uiSleep 3;
};
{ deleteMarkerLocal _x } forEach _markers;
};
} else {
radarActive = false;
if (!isNull GZ_RADAR_THREAD) then { terminate GZ_RADAR_THREAD; GZ_RADAR_THREAD = scriptNull; };
{ deleteMarkerLocal _x } forEach allRadarMarkers; allRadarMarkers = [];
hint "Радар деактивирован";
};
call fnc_closeMainMenu;
};
// ================ МЕДИЦИНСКИЕ ДРОНЫ ================
fnc_activateMedDrones = { if (DYN_MED_DRONES_ACTIVE) exitWith { DYN_MED_DRONES_ACTIVE = false; { if (!isNull _x) then { deleteVehicle _x; }; } forEach DYN_MED_VEHICLES; DYN_MED_VEHICLES = []; hint " Система эвакуации отозвана!"; call fnc_closeMainMenu; }; DYN_MED_DRONES_ACTIVE = true; DYN_MED_VEHICLES = []; hint " Система медицинской эвакуации АКТИВИРОВАНА!"; [] spawn fnc_medEvacLoop; call fnc_closeMainMenu; };
fnc_medEvacLoop = {
private _stillRequiredTime = 60;
while {DYN_MED_DRONES_ACTIVE} do {
private _currentTime = time; private _wounded = [];
{ private _unit = _x; if (!alive _unit || isPlayer _unit || side _unit != EAST || _unit getVariable ["DYN_MED_EVAC_SENT", false]) then { continue; };
private _isHurt = (damage _unit > 0.01) || (_unit getVariable ["ace_medical_blood", 6.0] < 5.9) || (_unit getVariable ["ace_medical_pain", 0] > 0.01) || (_unit getVariable ["ace_medical_isUnconscious", false]) || (lifeState _unit != "HEALTHY");
if (!_isHurt) then { _unit setVariable ["DYN_MED_STILL_SINCE", nil]; _unit setVariable ["DYN_MED_LAST_POS", nil]; continue; };
private _currentPos = getPos _unit; private _lastPos = _unit getVariable ["DYN_MED_LAST_POS", []]; private _stillSince = _unit getVariable ["DYN_MED_STILL_SINCE", -1];
private _hasMoved = false; if (count _lastPos > 0 && {_currentPos distance _lastPos > 2}) then { _hasMoved = true; };
if (_hasMoved) then { _unit setVariable ["DYN_MED_LAST_POS", _currentPos]; _unit setVariable ["DYN_MED_STILL_SINCE", _currentTime]; } else { if (_stillSince == -1) then { _unit setVariable ["DYN_MED_LAST_POS", _currentPos]; _unit setVariable ["DYN_MED_STILL_SINCE", _currentTime]; } else { if (_currentTime - _stillSince >= _stillRequiredTime) then { _wounded pushBack _unit; }; }; };
} forEach allUnits;
if (count _wounded > 0) then { { private _target = _x; _target setVariable ["DYN_MED_EVAC_SENT", true]; [_target] spawn fnc_spawnMedQuad; } forEach _wounded; };
DYN_MED_VEHICLES = DYN_MED_VEHICLES select { !isNull _x && alive _x }; sleep 5;
};
};
fnc_spawnMedQuad = {
params ["_target"];
private _targetName = name _target; private _targetClass = typeOf _target; private _targetPos = getPos _target;
_target setVariable ["DYN_MED_SPAWN_DATA", [_targetName, _targetClass, _targetPos]];
private _spawnPos = _targetPos getPos [150, random 360]; _spawnPos set [2, 0];
private _vehGroup = createGroup [EAST, true]; private _quad = "O_Quadbike_01_F" createVehicle _spawnPos; private _medic = _vehGroup createUnit ["O_medic_F", _spawnPos, [], 0, "FORM"];
_medic moveInDriver _quad; _medic allowDamage false; _quad allowDamage false; _vehGroup setCombatMode "BLUE"; _vehGroup setBehaviour "CARELESS";
DYN_MED_VEHICLES pushBack _quad;
[_quad, _medic, _target, _vehGroup] spawn {
params ["_quad", "_medic", "_target", "_vehGroup"];
private _evacComplete = false;
while {DYN_MED_DRONES_ACTIVE && !_evacComplete} do {
private _spawnData = _target getVariable ["DYN_MED_SPAWN_DATA", ["Неизвестный", "O_Soldier_F", [0,0,0]]];
private _targetPos = _spawnData select 2;
if (!alive _target) then { _target setVariable ["DYN_MED_EVAC_SENT", nil]; private _exitPos = _targetPos getPos [300, random 360]; while {count (waypoints _vehGroup) > 0} do { deleteWaypoint ((waypoints _vehGroup) select 0); }; private _wp = _vehGroup addWaypoint [_exitPos, 0]; _wp setWaypointType "MOVE"; _wp setWaypointSpeed "FULL"; waitUntil {sleep 1; _quad distance _exitPos < 50 || !alive _quad || !DYN_MED_DRONES_ACTIVE}; if (!isNull _quad) then { deleteVehicle _medic; deleteVehicle _quad; }; break; };
private _currentTargetPos = getPos _target; private _dist = _quad distance _currentTargetPos;
while {count (waypoints _vehGroup) > 0} do { deleteWaypoint ((waypoints _vehGroup) select 0); };
private _wp = _vehGroup addWaypoint [_currentTargetPos, 3]; _wp setWaypointType "MOVE"; _wp setWaypointSpeed "NORMAL"; _wp setWaypointBehaviour "CARELESS";
if (_dist < 10) then { sleep 2; deleteVehicle _target; private _exitPos = _currentTargetPos getPos [250, random 360]; while {count (waypoints _vehGroup) > 0} do { deleteWaypoint ((waypoints _vehGroup) select 0); }; private _wpExit = _vehGroup addWaypoint [_exitPos, 0]; _wpExit setWaypointType "MOVE"; _wpExit setWaypointSpeed "FULL"; waitUntil {sleep 1; _quad distance _exitPos < 50 || !alive _quad || !DYN_MED_DRONES_ACTIVE}; if (!isNull _quad) then { deleteVehicle _medic; deleteVehicle _quad; }; sleep 180; if (DYN_MED_DRONES_ACTIVE) then { private _respawnGroup = createGroup [EAST, true]; private _newUnit = _respawnGroup createUnit [_targetClass, _targetPos, [], 0, "FORM"]; _newUnit setName _targetName; _newUnit setDamage 0; }; _evacComplete = true; break; };
sleep 2;
};
};
};
// ================ МЕНЮ ================
fnc_attachMenuToUnit = { params ["_u"]; if (isNull _u) exitWith {}; private _oa = _u getVariable ["DYN_MENU_ACTIONS", []]; { if (_x != -1) then { _u removeAction _x }; } forEach _oa; private _na = []; private _id = _u addAction ["<t color='#FF8800' size='1.3'>ОТКРЫТЬ МЕНЮ</t>", { call fnc_openMainMenu; }, nil, 10, false, true, "", "true", 5]; _na pushBack _id; private _idQ = _u addAction ["<t color='#FF6600' size='1.3'> КВАДРОЦИКЛ 350 КМ/Ч</t>", { call fnc_toggleQuadbikeBoost; }, nil, 9, false, true, "", "true", 5]; _na pushBack _idQ; private _idT = _u addAction ["<t color='#00FF88' size='1.3'>⚡ ТЕЛЕПОРТ ВСЕХ ВОСТОЧНЫХ</t>", { call fnc_teleportAllEastToMapPoint; }, nil, 8, false, true, "", "true", 5]; _na pushBack _idT; if (DYN_SWITCH_MODE) then { private _id2 = _u addAction ["<t color='#FFAA00' size='1.5'>ВЕРНУТЬСЯ К ИГРОКУ</t>", { call fnc_returnToMainPlayer; }, nil, 11, true, true, "", "true", 5]; private _id3 = _u addAction ["<t color='#00AAFF' size='1.3'>УСКОРЕНИЕ ДРОНА 600</t>", { call fnc_toggleDroneBoost; }, nil, 11, true, true, "", "true", 5]; private _id4 = _u addAction ["<t color='#FF4400' size='1.3'> АВТОПИЛОТ: ПОИСК И УНИЧТОЖЕНИЕ</t>", { call DRONE_searchAndDestroy; }, nil, 11, true, true, "", "true", 5]; _na pushBack _id2; _na pushBack _id3; _na pushBack _id4; }; _u setVariable ["DYN_MENU_ACTIONS", _na]; };
fnc_switchToUnit = { params ["_tu"]; if (isNull _tu || !alive _tu || side _tu != east) exitWith { hint "Юнит не найден!" }; call fnc_removeEastUnitsMapMarkers; if (isNull DYN_MAIN_PLAYER) then { DYN_MAIN_PLAYER = player; DYN_PLAYER_SIDE = east; DYN_PLAYER_UNIT_TYPE = typeOf player; DYN_PLAYER_LOADOUT = getUnitLoadout player; DYN_MAIN_PLAYER_POS = getPos player; }; [player] call fnc_attachMenuToUnit; selectPlayer _tu; DYN_SWITCH_MODE = true; [_tu] call fnc_clearUnitHandlers; [_tu] call fnc_addSwitchDeathHandler; [_tu] call fnc_attachMenuToUnit; };
fnc_returnToMainPlayer = { if (isNull DYN_MAIN_PLAYER) exitWith { hint "Основной игрок не найден!" }; private _sp = if (count DYN_MAIN_PLAYER_POS > 0) then { DYN_MAIN_PLAYER_POS } else { getPos player }; if (!alive DYN_MAIN_PLAYER) then { private _grp = createGroup east; private _nu = _grp createUnit [DYN_PLAYER_UNIT_TYPE, _sp, [], 0, "NONE"]; _nu setUnitLoadout DYN_PLAYER_LOADOUT; _nu setDamage 0; _nu setVariable ["DYN_SIDE", east, true]; DYN_MAIN_PLAYER = _nu; [_nu] call fnc_addMainPlayerDeathHandler; [_nu] call fnc_addRankDamageHandler; }; [player] call fnc_attachMenuToUnit; selectPlayer DYN_MAIN_PLAYER; DYN_SWITCH_MODE = false; DRONE_autoPilotActive = false; GZ_isControllingDrone = false; GZ_isControllingPlane = false; GZ_isControllingMegaDrone = false; [DYN_MAIN_PLAYER] call fnc_attachMenuToUnit; };
fnc_createEastUnitsMapMarkers = { { try { deleteMarkerLocal _x; } catch {}; } forEach DYN_SWITCH_MAP_MARKERS; DYN_SWITCH_MAP_MARKERS = []; private _eu = allUnits select { side _x == east && alive _x && !isPlayer _x }; private _c = 0; { private _u = _x; private _p = getPos _u; private _tn = [_u] call fnc_getUnitTypeName; private _mn = format ["switch_east_%1_%2", round diag_tickTime, _c]; private _m = createMarkerLocal [_mn, _p]; if (_u isKindOf "Man") then { _m setMarkerTypeLocal "mil_triangle"; _m setMarkerColorLocal "ColorGREEN"; _m setMarkerSizeLocal [0.7, 0.7]; } else { private _v = vehicle _u; if (_v isKindOf "Tank") then { _m setMarkerTypeLocal "mil_box"; _m setMarkerColorLocal "ColorGREEN"; _m setMarkerSizeLocal [1.0, 1.0]; } else { if (_v isKindOf "Air") then { _m setMarkerTypeLocal "mil_triangle"; _m setMarkerColorLocal "ColorCYAN"; _m setMarkerSizeLocal [1.2, 1.2]; } else { _m setMarkerTypeLocal "mil_box"; _m setMarkerColorLocal "ColorGREEN"; _m setMarkerSizeLocal [0.9, 0.9]; }; }; }; _m setMarkerTextLocal format [" %1 %2", _tn, _c + 1]; DYN_SWITCH_MAP_MARKERS pushBack _mn; _c = _c + 1; } forEach _eu; private _pm = createMarkerLocal ["switch_player_pos", getPos player]; _pm setMarkerTypeLocal "mil_start"; _pm setMarkerColorLocal "ColorYELLOW"; _pm setMarkerSizeLocal [1.2, 1.2]; _pm setMarkerTextLocal " ВЫ"; DYN_SWITCH_MAP_MARKERS pushBack "switch_player_pos"; _c; };
fnc_removeEastUnitsMapMarkers = { { try { deleteMarkerLocal _x; } catch {}; } forEach DYN_SWITCH_MAP_MARKERS; DYN_SWITCH_MAP_MARKERS = []; if (DYN_SWITCH_MAP_EH != -1) then { try { removeMissionEventHandler ["MapSingleClick", DYN_SWITCH_MAP_EH]; } catch {}; DYN_SWITCH_MAP_EH = -1; }; };
fnc_showMapForSwitch = { private _c = call fnc_createEastUnitsMapMarkers; if (_c == 0) exitWith { hint "Нет восточных юнитов!" }; openMap true; DYN_SWITCH_MAP_EH = addMissionEventHandler ["MapSingleClick", { params ["_u","_p","_a","_s"]; private _eu = allUnits select { side _x == east && alive _x && !isPlayer _x }; private _nu = objNull; private _md = 100; { private _d = _x distance _p; if (_d < _md) then { _md = _d; _nu = _x; }; } forEach _eu; if (!isNull _nu) then { [_nu] call fnc_switchToUnit; openMap false; } else { hint "Кликните ближе к маркеру."; }; removeMissionEventHandler ["MapSingleClick", _thisEventHandler]; DYN_SWITCH_MAP_EH = -1; }]; [] spawn { waitUntil {sleep 0.5; !visibleMap}; call fnc_removeEastUnitsMapMarkers; }; };
fnc_toggleRespawnSystem = { DYN_RESPAWN_ENABLED = !DYN_RESPAWN_ENABLED; if (DYN_RESPAWN_ENABLED) then { hint "Возрождение ВКЛ"; } else { hint "Возрождение ВЫКЛ"; }; };
// ================ СЧЁТЧИК ================
fnc_initAmmoCounter = { DYN_AMMO_COUNTER_ACTIVE = true; [] spawn { while {DYN_AMMO_COUNTER_ACTIVE} do { if (!isNull player) then { private _w = currentWeapon player; if (_w != "") then { private _cm = currentMagazine player; if (_cm != "") then { private _ca = player ammo _w; private _ma = getNumber (configFile >> "CfgMagazines" >> _cm >> "count"); if (_ma > 0) then { private _pr = (_ca / _ma) * 100; private _tx = format ["ПАТРОНЫ: %1 / %2", _ca, _ma]; if (_pr <= 25) then { hintSilent parseText format ["<t size='1.5' color='#FF0000' align='left'>%1</t>", _tx]; } else { if (_pr <= 50) then { hintSilent parseText format ["<t size='1.5' color='#FFFF00' align='left'>%1</t>", _tx]; } else { hintSilent parseText format ["<t size='1.5' color='#00FF00' align='left'>%1</t>", _tx]; }; }; }; }; }; }; sleep 0.5; }; }; };
fnc_toggleAmmoCounter = { DYN_AMMO_COUNTER_ACTIVE = !DYN_AMMO_COUNTER_ACTIVE; if (DYN_AMMO_COUNTER_ACTIVE) then { hint "Счётчик ВКЛ"; [] spawn fnc_initAmmoCounter; } else { hint "Счётчик ВЫКЛ"; }; };
// ================ СКАНЕР ================
fnc_toggleEnemyScanner = { DYN_SCANNER_ACTIVE = !DYN_SCANNER_ACTIVE; if (DYN_SCANNER_ACTIVE) then { systemChat "Сканер ВКЛ!"; if (!DYN_SCANNER_RUNNING) then { DYN_SCANNER_RUNNING = true; [] spawn fnc_enemyScannerLoop; }; } else { systemChat "Сканер ВЫКЛ!"; DYN_SCANNER_RUNNING = false; { try { deleteMarkerLocal _x; } catch {}; } forEach DYN_SCANNER_MARKERS; DYN_SCANNER_MARKERS = []; if (DYN_SCANNER_EH != -1) then { try { removeMissionEventHandler ["Draw3D", DYN_SCANNER_EH]; } catch {}; DYN_SCANNER_EH = -1; }; }; };
fnc_enemyScannerLoop = { private _mc = createHashMap; private _lu = 0; while {DYN_SCANNER_ACTIVE && DYN_SCANNER_RUNNING} do { try { if (time - _lu > 2) then { _lu = time; private _au = allUnits select { alive _x && !(_x isKindOf "Animal") && !isPlayer _x }; private _ak = []; { private _u = _x; private _uk = str _u; private _p = getPos _u; private _mn = _mc getOrDefault [_uk, ""]; if (_mn == "") then { _mn = format ["scanner_%1_%2", round diag_tickTime, _forEachIndex]; private _m = createMarkerLocal [_mn, _p]; private _iv = !(_u isKindOf "Man"); if (_iv) then { _m setMarkerTypeLocal "mil_box"; _m setMarkerColorLocal "ColorGREEN"; _m setMarkerSizeLocal [1.0, 1.0]; } else { if (side _u == east) then { _m setMarkerTypeLocal "mil_dot"; _m setMarkerColorLocal "ColorRED"; _m setMarkerSizeLocal [0.6, 0.6]; } else { _m setMarkerTypeLocal "mil_dot"; _m setMarkerColorLocal "ColorBLUE"; _m setMarkerSizeLocal [0.6, 0.6]; }; }; private _tn = [_u] call fnc_getUnitTypeName; private _sn = if (side _u == east) then { "В" } else { "З" }; _m setMarkerTextLocal format ["%1 %2", _sn, _tn]; DYN_SCANNER_MARKERS pushBack _mn; _mc set [_uk, _mn]; } else { _mn setMarkerPosLocal _p; }; _ak pushBack _uk; } forEach _au; private _kr = []; { if (!(_x in _ak)) then { private _m = _mc getOrDefault [_x, ""]; if (_m != "") then { try { deleteMarkerLocal _m; } catch {}; _kr pushBack _x; }; }; } forEach (keys _mc); { _mc deleteAt _x; } forEach _kr; DYN_SCANNER_MARKERS = DYN_SCANNER_MARKERS select { _x != "" }; }; if (DYN_SCANNER_EH != -1) then { try { removeMissionEventHandler ["Draw3D", DYN_SCANNER_EH]; } catch {}; DYN_SCANNER_EH = -1; }; DYN_SCANNER_EH = addMissionEventHandler ["Draw3D", { if (!DYN_SCANNER_ACTIVE || !DYN_SCANNER_RUNNING) exitWith {}; try { private _en = []; { if (alive _x && !(_x isKindOf "Animal") && !isPlayer _x) then { _en pushBack [player distance _x, _x]; }; } forEach (allUnits select {true}); _en sort true; private _ne = []; for "_i" from 0 to (DYN_SCANNER_NEAREST_COUNT - 1) do { if (_i < count _en) then { _ne pushBack (_en select _i); }; }; { _x params ["_d","_u"]; if (alive _u) then { private _p = getPos _u; private _h = if (_u isKindOf "Man") then { 1.8 } else { 3 }; private _wp = [(_p select 0), (_p select 1), ((_p select 2) + _h)]; private _c = []; private _iv = !(_u isKindOf "Man"); if (_iv) then { _c = [0, 1, 0, 0.9]; } else { if (side _u == east) then { _c = [1, 0, 0, 0.9]; } else { _c = [0, 0, 1, 0.9]; }; }; drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", _c, _wp, 1.2, 1.2, 0, "", 0, 0.05, "TahomaB"]; private _tn = [_u] call fnc_getUnitTypeName; private _sn = if (side _u == east) then { "В" } else { "З" }; drawIcon3D ["", _c, [_wp select 0, _wp select 1, (_wp select 2) + 2.5], 0, 0, 0, format ["%1 %2 | %3м", _sn, _tn, round _d], 0, 0.04, "TahomaB"]; }; } forEach _ne; } catch {}; }]; } catch { sleep 2; }; sleep 2; }; };
// ================ СИСТЕМА ТЕХНИКИ ================
fnc_activateSmartVehicleSystem = { if (DYN_SMART_VEHICLE_ACTIVE) exitWith { hint "Система уже активна!" }; DYN_SMART_VEHICLE_ACTIVE = true; DYN_VEHICLE_LAST_SPAWN_TIME = time; [] spawn fnc_spawnSmartVehicleImmediate; [] spawn fnc_smartVehicleLoop; call fnc_closeMainMenu; };
fnc_deactivateSmartVehicleSystem = { DYN_SMART_VEHICLE_ACTIVE = false; { try { if (!isNull _x) then { if (count crew _x > 0) then { { deleteVehicle _x; } forEach crew _x; }; deleteVehicle _x; }; } catch {}; } forEach DYN_SMART_VEHICLES; DYN_SMART_VEHICLES = []; call fnc_closeMainMenu; };
fnc_spawnSmartVehicleImmediate = { private _av = DYN_SMART_VEHICLES select {alive _x}; DYN_SMART_VEHICLES = _av; private _cnt = count _av; if (_cnt < DYN_AI_MAX_VEHICLES) then { for "_i" from 1 to (DYN_AI_MAX_VEHICLES - _cnt) do { private _sp = getPos player; private _vt = selectRandom DYN_SMART_VEHICLE_TYPES; private _veh = createVehicle [_vt, _sp getPos [100 + random 200, random 360], [], 0, "NONE"]; _veh setDir random 360; _veh setVehicleAmmo 1; _veh setFuel 1; _veh setDamage 0; _veh setVariable ["DYN_SIDE", east, true]; DYN_SMART_VEHICLES pushBack _veh; private _cg = createGroup east; private _dr = _cg createUnit ["O_Soldier_F", getPos _veh, [], 0, "FORM"]; _dr moveInDriver _veh; private _gn = _cg createUnit ["O_Soldier_F", getPos _veh, [], 0, "FORM"]; _gn moveInGunner _veh; private _cm = _cg createUnit ["O_Soldier_F", getPos _veh, [], 0, "FORM"]; _cm moveInCommander _veh; _cg setBehaviour "COMBAT"; _cg setCombatMode "RED"; _cg setSpeedMode "FULL"; private _en = [_dr] call fnc_findNearestEnemy; if (!isNull _en) then { private _ep = getPos _en; private _wp = _cg addWaypoint [_ep, 0]; _wp setWaypointType "SAD"; _wp setWaypointBehaviour "COMBAT"; _wp setWaypointCombatMode "RED"; _wp setWaypointSpeed "FULL"; _cg setCurrentWaypoint _wp; _veh reveal [_en, 4]; _veh doWatch _en; _veh commandTarget _en; _veh doMove _ep; }; }; }; };
fnc_smartVehicleLoop = { while {DYN_SMART_VEHICLE_ACTIVE} do { sleep 300; if (!DYN_SMART_VEHICLE_ACTIVE) exitWith {}; private _av = DYN_SMART_VEHICLES select {alive _x}; DYN_SMART_VEHICLES = _av; private _cnt = count _av; if (_cnt < DYN_AI_MAX_VEHICLES && {(time - DYN_VEHICLE_LAST_SPAWN_TIME) >= 300}) then { for "_i" from 1 to (DYN_AI_MAX_VEHICLES - _cnt) do { private _sp = getPos player; private _vt = selectRandom DYN_SMART_VEHICLE_TYPES; private _veh = createVehicle [_vt, _sp getPos [100 + random 200, random 360], [], 0, "NONE"]; _veh setDir random 360; _veh setVehicleAmmo 1; _veh setFuel 1; _veh setDamage 0; _veh setVariable ["DYN_SIDE", east, true]; DYN_SMART_VEHICLES pushBack _veh; private _cg = createGroup east; private _dr = _cg createUnit ["O_Soldier_F", getPos _veh, [], 0, "FORM"]; _dr moveInDriver _veh; private _gn = _cg createUnit ["O_Soldier_F", getPos _veh, [], 0, "FORM"]; _gn moveInGunner _veh; private _cm = _cg createUnit ["O_Soldier_F", getPos _veh, [], 0, "FORM"]; _cm moveInCommander _veh; _cg setBehaviour "COMBAT"; _cg setCombatMode "RED"; _cg setSpeedMode "FULL"; private _en = [_dr] call fnc_findNearestEnemy; if (!isNull _en) then { private _ep = getPos _en; private _wp = _cg addWaypoint [_ep, 0]; _wp setWaypointType "SAD"; _wp setWaypointBehaviour "COMBAT"; _wp setWaypointCombatMode "RED"; _wp setWaypointSpeed "FULL"; _cg setCurrentWaypoint _wp; _veh reveal [_en, 4]; _veh doWatch _en; _veh commandTarget _en; _veh doMove _ep; }; }; DYN_VEHICLE_LAST_SPAWN_TIME = time; }; }; };
// ================ ПОДКРЕПЛЕНИЕ И ТАНК ================
fnc_callReinforcement = { if (DYN_ARSENAL_OPEN) exitWith { hint "Закройте арсенал!" }; private _totalEast = count (allUnits select {side _x == east && alive _x && !isPlayer _x}); if (_totalEast >= DYN_AI_MAX_UNITS) exitWith { hint format ["Лимит %1 юнитов достигнут!", DYN_AI_MAX_UNITS]; call fnc_closeMainMenu; }; private _pg = group player; private _sp = player getPos [50, random 360]; private _uc = [["O_Soldier_AR_F","Пулемётчик"],["O_Soldier_AR_F","Пулемётчик"],["O_Soldier_AR_F","Пулемётчик"],["O_Soldier_AA_F","ПЗРК"],["O_Soldier_AA_F","ПЗРК"],["O_Soldier_AA_F","ПЗРК"],["O_Soldier_GL_F","Гранатомётчик"],["O_Soldier_GL_F","Гранатомётчик"],["O_Sharpshooter_F","Снайпер"],["O_Sharpshooter_F","Снайпер"],["O_HeavyGunner_F","Пулемётчик"],["O_HeavyGunner_F","Пулемётчик"],["O_medic_F","Медик"],["O_medic_F","Медик"]]; { _x params ["_ucls","_role"]; private _unit = _pg createUnit [_ucls, _sp, [], 10, "FORM"]; _unit setSkill 0.8; _unit setUnitPos "AUTO"; _unit allowFleeing 0; _unit setBehaviour "AWARE"; _unit setCombatMode "YELLOW"; _unit setVariable ["DYN_SIDE", east, true]; _unit reveal [player, 4]; player reveal [_unit, 4]; _unit addItem "FirstAidKit"; private _weapons = weapons _unit; { private _mags = getArray (configFile >> "CfgWeapons" >> _x >> "magazines"); if (count _mags > 0) then { for "_i" from 1 to 4 do { _unit addMagazine (_mags select 0); }; }; } forEach _weapons; if (_role == "ПЗРК") then { for "_i" from 1 to 3 do { _unit addMagazine "Titan_AA"; }; }; if (_role == "Медик") then { for "_i" from 1 to 6 do { _unit addItem "FirstAidKit"; }; for "_i" from 1 to 2 do { _unit addItem "Medikit"; }; }; _unit addMagazine "HandGrenade"; _unit addMagazine "SmokeShell"; } forEach _uc; for "_i" from 1 to 6 do { [_pg, _sp getPos [random 20, random 360]] call fnc_createRPGBomber; }; private _tankPos = player getPos [80, random 360]; private _tank = createVehicle ["O_MBT_02_cannon_F", _tankPos, [], 0, "NONE"]; _tank setDir (player getDir _tankPos); _tank setVehicleAmmo 1; _tank setFuel 1; _tank setDamage 0; _tank setVariable ["DYN_SIDE", east, true]; private _cmdr = _pg createUnit ["O_officer_F", _tankPos, [], 0, "FORM"]; _cmdr moveInCommander _tank; private _gunr = _pg createUnit ["O_Soldier_F", _tankPos, [], 0, "FORM"]; _gunr moveInGunner _tank; private _drvr = _pg createUnit ["O_Soldier_F", _tankPos, [], 0, "FORM"]; _drvr moveInDriver _tank; { _x setSkill 0.9; _x allowFleeing 0; _x setBehaviour "AWARE"; _x setCombatMode "YELLOW"; _x setVariable ["DYN_SIDE", east, true]; _x reveal [player, 4]; player reveal [_x, 4]; } forEach [_cmdr, _gunr, _drvr]; _tank addEventHandler ["Fired", { params ["_v"]; _v setVehicleAmmo 1; }]; _tank addEventHandler ["Hit", { params ["_v"]; if (fuel _v < 0.5) then { _v setFuel 1; }; }]; [_tank] spawn { params ["_t"]; while { alive _t } do { if (fuel _t < 0.
then { _t setFuel 1; }; if ((damage _t) > 0.3) then { _t setDamage ((damage _t) - 0.1); }; sleep 5; }; }; _pg setBehaviour "AWARE"; _pg setCombatMode "YELLOW"; _pg setFormation "WEDGE"; hint "Подкрепление прибыло!"; call fnc_closeMainMenu; };
fnc_callTank = { if (DYN_ARSENAL_OPEN) exitWith { hint "Закройте арсенал!" }; private _pg = group player; private _tankPos = player getPos [80, random 360]; private _tank = createVehicle ["O_MBT_02_cannon_F", _tankPos, [], 0, "NONE"]; _tank setDir (player getDir _tankPos); _tank setVehicleAmmo 1; _tank setFuel 1; _tank setDamage 0; _tank setVariable ["DYN_SIDE", east, true]; private _cmdr = _pg createUnit ["O_officer_F", _tankPos, [], 0, "FORM"]; _cmdr moveInCommander _tank; private _gunr = _pg createUnit ["O_Soldier_F", _tankPos, [], 0, "FORM"]; _gunr moveInGunner _tank; private _drvr = _pg createUnit ["O_Soldier_F", _tankPos, [], 0, "FORM"]; _drvr moveInDriver _tank; { _x setSkill 0.9; _x allowFleeing 0; _x setBehaviour "AWARE"; _x setCombatMode "YELLOW"; _x setVariable ["DYN_SIDE", east, true]; _x reveal [player, 4]; player reveal [_x, 4]; } forEach [_cmdr, _gunr, _drvr]; _tank addEventHandler ["Fired", { params ["_v"]; _v setVehicleAmmo 1; }]; _tank addEventHandler ["Hit", { params ["_v"]; if (fuel _v < 0.5) then { _v setFuel 1; }; }]; [_tank] spawn { params ["_t"]; while { alive _t } do { if (fuel _t < 0.
then { _t setFuel 1; }; if ((damage _t) > 0.3) then { _t setDamage ((damage _t) - 0.1); }; sleep 5; }; }; hint "Танк прибыл!"; call fnc_closeMainMenu; };
// ================ ИНЖЕНЕР ================
fnc_spawnQuadbike = { if (isNull player || DYN_ARSENAL_OPEN) exitWith {}; private _v = createVehicle ["C_Quadbike_01_F", player getPos [5, random 360], [], 0, "NONE"]; _v setDir getDir player; _v setFuel 1; _v setDamage 0; _v setVariable ["DYN_SIDE", east, true]; hint "Квадроцикл создан!"; call fnc_closeMainMenu; };
fnc_spawnTurret = { params ["_t","_l"]; if (isNull player || DYN_ARSENAL_OPEN) exitWith {}; private _v = createVehicle [_t, player getPos [5, getDir player], [], 0, "CAN_COLLIDE"]; _v setDir getDir player; _v setVariable ["DYN_SIDE", east, true]; private _g = createGroup east; private _gn = _g createUnit [selectRandom ["O_Soldier_AR_F","O_HeavyGunner_F","O_Soldier_TL_F"], getPos _v, [], 0, "FORM"]; _gn moveInGunner _v; _gn setSkill 0.7; _gn allowFleeing 0; _g setBehaviour "COMBAT"; _g setCombatMode "RED"; hint format ["%1 установлена!", _l]; call fnc_closeMainMenu; };
fnc_spawnFort = { params ["_t","_l"]; if (isNull player || DYN_ARSENAL_OPEN) exitWith {}; private _f = createVehicle [_t, player getPos [3, getDir player], [], 0, "CAN_COLLIDE"]; _f setDir getDir player; _f setVariable ["DYN_SIDE", east, true]; _f setDamage 0; hint format ["%1 построено!", _l]; call fnc_closeMainMenu; };
// ============================================================
// СУПЕР-СОЛДАТЫ (v19.15: респавн и мега-взрыв вынесены отдельно)
// ============================================================
fnc_spawnSuperSoldiers = {
if (DYN_ARSENAL_OPEN) exitWith { hint "Закройте арсенал!" };
private _totalEast = count (allUnits select {side _x == east && alive _x && !isPlayer _x});
if (_totalEast >= DYN_AI_MAX_UNITS) exitWith { hint format ["Лимит %1 достигнут!", DYN_AI_MAX_UNITS]; call fnc_closeMainMenu; };
DYN_SUPER_SOLDIERS_ACTIVE = true;
private _grp = group player;
private _spawnPoint = player getPos [10, random 360];
SS_REINFORCEMENT_SPAWNED = false;
for "_i" from 1 to 3 do {
private _unit = _grp createUnit ["O_Sniper_F", _spawnPoint getPos [random 5, random 360], [], 0, "FORM"];
_unit addEventHandler ["HandleDamage", { params ["_unit","","_damage","_source"]; if (!isNull _source && {_source != _unit}) then { _unit setVariable ["UNDER_FIRE", true]; _unit setVariable ["FIRE_SOURCE", _source]; }; _damage * 0.05 }];
_unit allowDamage true; _unit setAnimSpeedCoef 5.0; _unit setSpeedMode "FULL";
_unit setSkill 1.0; _unit setSkill ["aimingAccuracy", 1.0]; _unit setSkill ["aimingShake", 1.0]; _unit setSkill ["aimingSpeed", 1.0]; _unit setSkill ["spotDistance", 1.0]; _unit setSkill ["spotTime", 1.0]; _unit setSkill ["courage", 1.0]; _unit setSkill ["commanding", 1.0]; _unit setSkill ["reloadSpeed", 1.0];
_unit setUnitTrait ["spotCoef", 0.2]; _unit setUnitTrait ["aimingSpeedCoef", 0.2]; _unit setUnitTrait ["aimingAccuracyCoef", 0.2]; _unit setUnitTrait ["aimingShakeCoef", 0.1]; _unit setUnitTrait ["loadCoef", 0.33]; _unit setUnitTrait ["recoilCoef", 0.2];
removeAllWeapons _unit; removeAllItems _unit; removeAllAssignedItems _unit; removeUniform _unit; removeVest _unit; removeBackpack _unit;
_unit forceAddUniform "U_O_FullGhillie_ard"; _unit addVest "V_TacVest_brn"; _unit addBackpack "B_TacticalPack_ocamo";
_unit addWeapon "srifle_DMR_05_hex_F"; _unit addPrimaryWeaponItem "optic_AMS"; _unit addPrimaryWeaponItem "muzzle_snds_93mmg"; _unit addPrimaryWeaponItem "bipod_01_F_blk";
_unit addWeapon "hgun_Rook40_F"; _unit addHandgunItem "muzzle_snds_L";
for "_j" from 1 to 15 do { _unit addMagazine "10Rnd_93x64_DMR_05_Mag"; };
for "_j" from 1 to 5 do { _unit addMagazine "16Rnd_9x21_Mag"; };
for "_j" from 1 to 8 do { _unit addMagazine "SmokeShell"; };
for "_j" from 1 to 6 do { _unit addMagazine "HandGrenade"; };
for "_j" from 1 to 5 do { _unit addItem "FirstAidKit"; };
_unit addEventHandler ["Fired", { params ["_unit","","","","","_magazine"]; if (_magazine != "") then { _unit addMagazine _magazine; }; }];
_unit setBehaviour "COMBAT"; _unit setCombatMode "RED";
_unit setVariable ["DYN_SIDE", east, true]; _unit setVariable ["DYN_SUPER_SOLDIER", true, true]; _unit setVariable ["HEALING", false]; _unit setVariable ["UNDER_FIRE", false]; _unit setVariable ["LAST_DRONE_LAUNCH", -999];
[_unit] spawn {
params ["_unit"];
private _lastArt = -999; private _nextArtDelay = 180 + random 120; private _lastSmoke = -999; private _lastGrenade = -999; private _lastPos = getPos _unit; private _lastMoveTime = time;
while {alive _unit} do {
private _currentPos = getPos _unit;
if (_currentPos distance _lastPos > 2) then { _lastPos = _currentPos; _lastMoveTime = time; };
if (time - _lastMoveTime > 300) then { deleteVehicle _unit; };
private _aliveSS = count (allUnits select { alive _x && (_x getVariable ["DYN_SUPER_SOLDIER", false]) });
if (_aliveSS <= 1 && !(missionNamespace getVariable ["SS_REINFORCEMENT_SPAWNED", false])) then {
missionNamespace setVariable ["SS_REINFORCEMENT_SPAWNED", true, true];
private _rand = floor(random 5);
switch (_rand) do {
case 0: { private _tankPos = _unit getPos [80, random 360]; private _tank = createVehicle ["O_MBT_02_cannon_F", _tankPos, [], 0, "NONE"]; _tank setDir (random 360); createVehicleCrew _tank; (crew _tank) joinSilent (createGroup east); systemChat " ТАНК Т-100 ВЫЗВАН!"; [_tank, _unit] spawn { params ["_tank", "_ss"]; while {alive _tank && alive _ss} do { private _enemies = allUnits select { alive _x && (side _x == west || side _x == resistance) && _x distance _ss < 500 }; if (count _enemies > 0) then { private _nearest = objNull; private _minD = 999999; { if (_x distance _tank < _minD) then { _minD = _x distance _tank; _nearest = _x; }; } forEach _enemies; if (!isNull _nearest) then { _tank doTarget _nearest; _tank doMove (getPos _ss); }; } else { _tank doMove (getPos _ss); }; sleep 2; }; }; };
case 1: { private _kamazPos = _unit getPos [120, random 360]; private _kamaz = createVehicle ["O_Truck_02_covered_F", _kamazPos, [], 0, "NONE"]; _kamaz setDir (random 360); createVehicleCrew _kamaz; (crew _kamaz) joinSilent (createGroup east); systemChat " КАМАЗ С ПЕХОТОЙ ВЫЕХАЛ!"; private _infGroup = createGroup east; for "_k" from 1 to 6 do { private _inf = _infGroup createUnit ["O_Soldier_F", _kamazPos, [], 0, "CARGO"]; _inf moveInCargo _kamaz; }; [_kamaz, _infGroup, _unit] spawn { params ["_kamaz", "_infGrp", "_ss"]; _kamaz doMove (getPos _ss); sleep 15; { if (alive _x) then { unassignVehicle _x; _x action ["eject", vehicle _x]; }; } forEach (units _infGrp); while {!isNull _ss && alive _ss} do { private _enemies = allUnits select { alive _x && (side _x == west || side _x == resistance) && _x distance _ss < 400 }; if (count _enemies > 0) then { { if (alive _x) then { _x doTarget (selectRandom _enemies); _x doMove (getPos _ss); }; } forEach (units _infGrp); }; sleep 3; }; }; };
case 2: { private _btrPos = _unit getPos [90, random 360]; private _btr = createVehicle ["O_APC_Wheeled_02_rcws_F", _btrPos, [], 0, "NONE"]; _btr setDir (random 360); createVehicleCrew _btr; (crew _btr) joinSilent (createGroup east); systemChat " БТР ВЫЗВАН!"; [_btr, _unit] spawn { params ["_btr", "_ss"]; while {alive _btr && alive _ss} do { private _enemies = allUnits select { alive _x && (side _x == west || side _x == resistance) && _x distance _ss < 500 }; if (count _enemies > 0) then { private _nearest = objNull; private _minD = 999999; { if (_x distance _btr < _minD) then { _minD = _x distance _btr; _nearest = _x; }; } forEach _enemies; if (!isNull _nearest) then { _btr doTarget _nearest; _btr doMove (getPos _ss); }; } else { _btr doMove (getPos _ss); }; sleep 2; }; }; };
case 3: { private _bmpPos = _unit getPos [90, random 360]; private _bmp = createVehicle ["O_APC_Tracked_02_cannon_F", _bmpPos, [], 0, "NONE"]; _bmp setDir (random 360); createVehicleCrew _bmp; (crew _bmp) joinSilent (createGroup east); systemChat " БМП ВЫЗВАНА!"; [_bmp, _unit] spawn { params ["_bmp", "_ss"]; while {alive _bmp && alive _ss} do { private _enemies = allUnits select { alive _x && (side _x == west || side _x == resistance) && _x distance _ss < 500 }; if (count _enemies > 0) then { private _nearest = objNull; private _minD = 999999; { if (_x distance _bmp < _minD) then { _minD = _x distance _bmp; _nearest = _x; }; } forEach _enemies; if (!isNull _nearest) then { _bmp doTarget _nearest; _bmp doMove (getPos _ss); }; } else { _bmp doMove (getPos _ss); }; sleep 2; }; }; };
case 4: { systemChat " ДЕСАНТ НА ПАРАШЮТАХ!"; private _dropPos = [ (getPos _unit select 0) + (random 40 - 20), (getPos _unit select 1) + (random 40 - 20), 200 ]; private _paraGroup = createGroup east; for "_k" from 1 to 10 do { private _paraPos = [ (_dropPos select 0) + (random 30 - 15), (_dropPos select 1) + (random 30 - 15), 200 ]; private _para = _paraGroup createUnit ["O_Soldier_F", _paraPos, [], 0, "FORM"]; _para addBackpack "B_Parachute"; _para setPos _paraPos; }; [_paraGroup, _unit] spawn { params ["_paraGrp", "_ss"]; sleep 8; while {!isNull _ss && alive _ss} do { private _enemies = allUnits select { alive _x && (side _x == west || side _x == resistance) && _x distance _ss < 400 }; if (count _enemies > 0) then { { if (alive _x) then { _x doTarget (selectRandom _enemies); _x doMove (getPos _ss); }; } forEach (units _paraGrp); }; sleep 3; }; }; };
};
};
if (_unit getVariable ["UNDER_FIRE", false]) then { private _src = _unit getVariable ["FIRE_SOURCE", objNull]; if (!isNull _src && alive _src && (time - _lastSmoke > 10)) then { _lastSmoke = time; private _dir = _unit getDir _src; private _smokePos = _unit getPos [2, _dir]; "SmokeShell" createVehicle _smokePos; }; _unit setVariable ["UNDER_FIRE", false]; };
if (damage _unit > 0.3 && !(_unit getVariable ["HEALING", false])) then { _unit setVariable ["HEALING", true]; "SmokeShell" createVehicle (getPos _unit); [_unit] spawn { params ["_u"]; sleep 2; _u setDamage 0; sleep 8; _u setVariable ["HEALING", false]; }; };
private _enemies = allUnits select { alive _x && (side _x == west || side _x == resistance) };
if (count _enemies > 0) then {
private _target = objNull; private _dist = 999999;
{ private _d = _unit distance _x; if (_d < _dist) then { _dist = _d; _target = _x; }; } forEach _enemies;
if (!isNull _target) then {
_unit reveal [_target, 4]; _unit doWatch _target; _unit commandTarget _target; _unit doMove (getPos _target);
private _isVeh = (_target isKindOf "Tank" || _target isKindOf "APC" || _target isKindOf "Car" || _target isKindOf "Air");
private _isAir = (_target isKindOf "Air");
private _infCount = count (_enemies select { !(_x isKindOf "Tank" || _x isKindOf "APC" || _x isKindOf "Car" || _x isKindOf "Air") && (_x distance _target) < 25 });
private _droneReady = (time - (_unit getVariable ["LAST_DRONE_LAUNCH", -999]) > 120);
if (_droneReady && {_dist > 50} && {_dist < 1500} && {(_infCount >= 3 || (_isVeh && {!_isAir}))}) then {
_unit setVariable ["LAST_DRONE_LAUNCH", time];
private _dronePos = [ (getPos _unit select 0) + (random 10 - 5), (getPos _unit select 1) + (random 10 - 5), 50 ];
private _drone = createVehicle ["O_UAV_01_F", _dronePos, [], 0, "FLY"]; _drone setPos _dronePos; _drone setDir (random 360);
[_drone, _target] spawn { params ["_drone", "_initialTarget"]; if (!alive _drone) exitWith {}; systemChat " Дрон-камикадзе запущен!"; while {alive _drone} do { private _enemies = allUnits select { alive _x && (side _x == west || side _x == resistance) }; if (count _enemies == 0) exitWith {}; private _target = objNull; private _dist = 999999; { private _d = _drone distance _x; if (_d < _dist) then { _dist = _d; _target = _x; }; } forEach _enemies; if (isNull _target) exitWith {}; private _enemyPos = getPos _target; _drone doMove _enemyPos; _drone doWatch _enemyPos; private _dir = _drone getDir _enemyPos; private _speed = 60; if (_dist < 300) then { _speed = 120; }; if (_dist < 150) then { _speed = 200; }; if (_dist < 80) then { _speed = 300; }; private _vertical = 0; if (_dist < 300) then { _vertical = -10; }; if (_dist < 150) then { _vertical = -25; }; if (_dist < 80) then { _vertical = -50; }; _drone setVelocity [(sin _dir) * _speed, (cos _dir) * _speed, _vertical]; if (_dist < 25) then { _drone setPos [_enemyPos select 0, _enemyPos select 1, (_enemyPos select 2) + 1]; "HelicopterExploBig" createVehicle (getPos _drone); private _victims = allUnits select { _x distance _drone < 50 && alive _x && (side _x == west || side _x == resistance) }; { _x setDamage 1 } forEach _victims; private _veh = vehicles select { _x distance _drone < 50 && alive _x && (side _x == west || side _x == resistance) }; { _x setDamage ((damage _x) + 0.
} forEach _veh; deleteVehicle _drone; systemChat " Дрон уничтожил цель!"; }; sleep 0.05; }; };
};
if ((time - _lastArt > _nextArtDelay) && {_dist > 30} && {_dist < 800}) then { _lastArt = time; _nextArtDelay = 180 + random 120; [_target] spawn { params ["_t"]; if (!alive _t) exitWith {}; private _tp = getPos _t; for "_k" from 1 to (1 + floor(random 3)) do { private _sx = (_tp select 0) + (random 110 - 55); private _sy = (_tp select 1) + (random 110 - 55); "HelicopterExploSmall" createVehicle [_sx, _sy, 0]; sleep (0.3 + random 0.5); }; }; };
if ((time - _lastGrenade >
&& {_dist < 40} && {!(_target isKindOf "Tank")}) then { _lastGrenade = time; [_unit, _target] spawn { params ["_u", "_t"]; if (!alive _u || !alive _t) exitWith {}; private _tp = getPos _t; "HelicopterExploSmall" createVehicle [(_tp select 0) + (random 4 - 2), (_tp select 1) + (random 4 - 2), 0]; }; };
};
};
sleep 1;
};
};
};
if (isNull DYN_SS_RESPAWN_THREAD || {scriptDone DYN_SS_RESPAWN_THREAD}) then { DYN_SS_RESPAWN_THREAD = [] spawn fnc_ssRespawnLoop; };
if (isNull DYN_SS_MEGA_BLAST_THREAD || {scriptDone DYN_SS_MEGA_BLAST_THREAD}) then { DYN_SS_MEGA_BLAST_THREAD = [] spawn fnc_ssMegaBlastLoop; };
hint "3 СУПЕР-СОЛДАТА созданы!"; call fnc_closeMainMenu;
};
fnc_ssRespawnLoop = {
while {true} do {
private _aliveSS = count (allUnits select { alive _x && (_x getVariable ["DYN_SUPER_SOLDIER", false]) });
if (_aliveSS == 0 && DYN_SUPER_SOLDIERS_ACTIVE) then {
systemChat "⏳ Супер-солдаты отсутствуют, новые появятся через 5 минут...";
sleep 300;
_aliveSS = count (allUnits select { alive _x && (_x getVariable ["DYN_SUPER_SOLDIER", false]) });
if (_aliveSS == 0 && DYN_SUPER_SOLDIERS_ACTIVE) then { systemChat " Спавн новых супер-солдат!"; SS_REINFORCEMENT_SPAWNED = false; call fnc_spawnSuperSoldiers; };
};
sleep 10;
};
};
fnc_ssMegaBlastLoop = {
while {true} do {
sleep 600;
if (!DYN_SUPER_SOLDIERS_ACTIVE) then { continue; };
private _enemies = allUnits select { alive _x && (side _x == west || side _x == resistance) && !isPlayer _x };
if (count _enemies < 3) then { continue; };
private _bestTarget = objNull; private _maxCluster = 0;
{ private _center = _x; private _nearEnemies = _enemies select { (_x distance _center) < 40 }; private _clusterSize = count _nearEnemies; if (_clusterSize > _maxCluster) then { _maxCluster = _clusterSize; _bestTarget = _center; }; } forEach _enemies;
if (isNull _bestTarget || _maxCluster < 3) then { continue; };
private _blastPos = getPos _bestTarget;
systemChat format ["☢ МЕГА-ВЗРЫВ! Скопление из %1 врагов!", _maxCluster];
for "_k" from 1 to 12 do { private _ex = (_blastPos select 0) + (random 30 - 15); private _ey = (_blastPos select 1) + (random 30 - 15); "HelicopterExploBig" createVehicle [_ex, _ey, 0]; sleep 0.1; };
private _victims = allUnits select { _x distance _blastPos < 70 && alive _x && (side _x == west || side _x == resistance) };
{ _x setDamage 1 } forEach _victims;
private _veh = vehicles select { _x distance _blastPos < 70 && alive _x && (side _x == west || side _x == resistance) };
{ _x setDamage ((damage _x) + 0.95) } forEach _veh;
"CraterLong" createVehicle _blastPos;
};
};
fnc_toggleGlobalAttack = {
DYN_SS_GLOBAL_ATTACK_ACTIVE = !DYN_SS_GLOBAL_ATTACK_ACTIVE;
if (DYN_SS_GLOBAL_ATTACK_ACTIVE) then {
hint "⚔ ПРИКАЗ АТАКИ ВСЕМ: ВКЛЮЧЕН (каждые 2 минуты)";
["ПРИКАЗ","Цикл атаки активирован",""] call DYN_addEvent;
if (!isNull DYN_SS_GLOBAL_ATTACK_THREAD) then { terminate DYN_SS_GLOBAL_ATTACK_THREAD; };
DYN_SS_GLOBAL_ATTACK_THREAD = [] spawn fnc_globalAttackLoop;
} else {
hint "⚔ ПРИКАЗ АТАКИ ВСЕМ: ВЫКЛЮЧЕН";
["ПРИКАЗ","Цикл атаки остановлен",""] call DYN_addEvent;
if (!isNull DYN_SS_GLOBAL_ATTACK_THREAD) then { terminate DYN_SS_GLOBAL_ATTACK_THREAD; };
DYN_SS_GLOBAL_ATTACK_THREAD = scriptNull;
};
call fnc_closeMainMenu;
};
fnc_globalAttackLoop = {
while {DYN_SS_GLOBAL_ATTACK_ACTIVE} do {
sleep 120;
if (!DYN_SS_GLOBAL_ATTACK_ACTIVE) exitWith {};
private _eastUnits = allUnits select { alive _x && side _x == east && !isPlayer _x };
private _enemies = allUnits select { alive _x && (side _x == west || side _x == resistance) && !isPlayer _x };
if (count _eastUnits > 0 && count _enemies > 0) then {
private _count = 0;
{ private _unit = _x; private _nearest = objNull; private _minD = 999999; { private _d = _unit distance _x; if (_d < _minD) then { _minD = _d; _nearest = _x; }; } forEach _enemies; if (!isNull _nearest && _minD < 2000) then { _unit reveal [_nearest, 4]; _unit doTarget _nearest; _unit doMove (getPos _nearest); _unit setBehaviour "COMBAT"; _unit setCombatMode "RED"; _count = _count + 1; }; } forEach _eastUnits;
if (_count > 0) then { systemChat format ["⚔ Общий приказ: %1 восточных юнитов атакуют врага!", _count]; ["ПРИКАЗ", format ["Атака: %1 юнитов", _count], ""] call DYN_addEvent; };
};
};
};
// ================ УДАЛИТЬ ВСЕХ ВОСТОЧНЫХ ================
fnc_deleteAllEast = {
call fnc_stopSuperSoldierSystems;
private _cnt = 0;
{ if (side _x == east && alive _x && !isPlayer _x) then { if (vehicle _x != _x) then { private _v = vehicle _x; { deleteVehicle _x; } forEach crew _v; deleteVehicle _v; } else { deleteVehicle _x; }; _cnt = _cnt + 1; }; } forEach (allUnits select {true});
{ if (side _x == east && alive _x) then { { deleteVehicle _x; } forEach crew _x; deleteVehicle _x; }; } forEach (vehicles select {true});
// Очистка тактических юнитов
{ [_x] call GZ_deleteVehicleWithCrew } forEach artilleryUnits; artilleryUnits = [];
if (!isNull artilleryGroup) then { deleteGroup artilleryGroup; artilleryGroup = grpNull; };
private _specOpsGroup = missionNamespace getVariable ["specOpsGroup", grpNull];
if (!isNull _specOpsGroup) then { { deleteVehicle _x } forEach units _specOpsGroup; deleteGroup _specOpsGroup; missionNamespace setVariable ["specOpsGroup", grpNull]; };
{ deleteVehicle _x } forEach supportUnits; supportUnits = [];
hint format ["Удалено %1 восточных юнитов/техники", _cnt]; call fnc_closeMainMenu;
};
fnc_stopSuperSoldierSystems = {
DYN_SUPER_SOLDIERS_ACTIVE = false;
DYN_SS_GLOBAL_ATTACK_ACTIVE = false;
if (!isNull DYN_SS_GLOBAL_ATTACK_THREAD) then { terminate DYN_SS_GLOBAL_ATTACK_THREAD; DYN_SS_GLOBAL_ATTACK_THREAD = scriptNull; };
if (!isNull DYN_SS_RESPAWN_THREAD) then { terminate DYN_SS_RESPAWN_THREAD; DYN_SS_RESPAWN_THREAD = scriptNull; };
if (!isNull DYN_SS_MEGA_BLAST_THREAD) then { terminate DYN_SS_MEGA_BLAST_THREAD; DYN_SS_MEGA_BLAST_THREAD = scriptNull; };
SS_REINFORCEMENT_SPAWNED = false;
systemChat "Система супер-солдат остановлена";
};
// ================ НАЗЕМНЫЕ ДРОНЫ-УБИЙЦЫ ================
fnc_spawnGroundKillerDrones = {
if (DYN_ARSENAL_OPEN) exitWith { hint "Закройте арсенал!" };
private _classes = ["WNZ_UGV_32_Stalker_O", "WNZ_UGV_31_Hunter_O", "O_UGV_02_Sniper_F"];
private _spawnPos = getPos player;
{
private _class = _x; private _pos = _spawnPos getPos [30 + random 30, random 360]; _pos set [2, 0];
private _ugv = createVehicle [_class, _pos, [], 0, "CAN_COLLIDE"]; _ugv setDir (random 360); _ugv setVehicleAmmo 1; _ugv setFuel 1; _ugv setDamage 0; _ugv setVariable ["DYN_SIDE", east, true];
createVehicleCrew _ugv; private _crew = crew _ugv; private _grp = group _ugv; if (isNull _grp) then { _grp = createGroup east; _crew joinSilent _grp; };
_grp setBehaviour "COMBAT"; _grp setCombatMode "RED"; _grp setSpeedMode "FULL";
_ugv addEventHandler ["Fired", { params ["_veh"]; _veh setVehicleAmmo 1; }];
[_ugv, _grp] spawn {
params ["_ugv", "_grp"]; private _lastPos = getPos _ugv; private _lastMoveTime = time;
while {alive _ugv} do {
sleep 1; if (!alive _ugv) exitWith {};
if (fuel _ugv < 0.
then { _ugv setFuel 1; };
private _vel = velocity _ugv; private _speed = speed _ugv;
if (_speed > 5 && _speed < 120) then { private _z = _vel select 2; if (_z > 2) then { _z = 2; }; if (_z < -5) then { _z = -5; }; _ugv setVelocity [(_vel select 0) * 1.8, (_vel select 1) * 1.8, _z]; };
private _currentPos = getPos _ugv;
if (_currentPos distance2D _lastPos > 5) then { _lastPos = _currentPos; _lastMoveTime = time; } else { if (time - _lastMoveTime > 600) then { "HelicopterExploBig" createVehicle (getPos _ugv); "Bo_GBU12_LGB" createVehicle (getPos _ugv); private _victims = allUnits select { _x distance _ugv < 50 && alive _x }; { _x setDamage 1 } forEach _victims; { deleteVehicle _x } forEach crew _ugv; deleteVehicle _ugv; }; };
private _enemies = allUnits select { alive _x && (side _x == west || side _x == resistance) && !isPlayer _x };
if (count _enemies > 0) then {
private _nearest = objNull; private _minDist = 999999;
{ private _d = _ugv distance _x; if (_d < _minDist) then { _minDist = _d; _nearest = _x; }; } forEach _enemies;
if (!isNull _nearest) then { _ugv doTarget _nearest; _ugv doMove (getPos _nearest); while {count (waypoints _grp) > 0} do { deleteWaypoint ((waypoints _grp) select 0); }; private _wp = _grp addWaypoint [getPos _nearest, 0]; _wp setWaypointType "SAD"; _wp setWaypointSpeed "FULL"; _grp setCurrentWaypoint _wp; };
};
};
};
} forEach _classes;
hint " 3 Наземных дрона-убийцы вызваны!"; call fnc_closeMainMenu;
};
// ================ ИИ ЦИКЛЫ ================
fnc_spawnAIVehicle = { params ["_enemyPos"]; private _vehicleTypes = ["O_MBT_02_cannon_F", "O_APC_Tracked_02_cannon_F", "O_APC_Wheeled_02_rcws_F", "O_MRAP_02_hmg_F", "O_MRAP_02_gmg_F"]; private _vehicleType = selectRandom _vehicleTypes; private _spawnPos = _enemyPos getPos [200 + random 300, random 360]; private _vehicle = createVehicle [_vehicleType, _spawnPos, [], 0, "NONE"]; _vehicle setDir random 360; _vehicle setVehicleAmmo 1; _vehicle setFuel 1; _vehicle setDamage 0; _vehicle setVariable ["DYN_SIDE", east, true]; private _group = createGroup east; private _driver = _group createUnit ["O_Soldier_F", _spawnPos, [], 0, "FORM"]; _driver moveInDriver _vehicle; private _gunner = _group createUnit ["O_Soldier_F", _spawnPos, [], 0, "FORM"]; _gunner moveInGunner _vehicle; private _commander = _group createUnit ["O_Soldier_F", _spawnPos, [], 0, "FORM"]; _commander moveInCommander _vehicle; _group setBehaviour "COMBAT"; _group setCombatMode "RED"; _group setSpeedMode "FULL"; private _wp = _group addWaypoint [_enemyPos, 0]; _wp setWaypointType "SAD"; _wp setWaypointBehaviour "COMBAT"; _wp setWaypointCombatMode "RED"; _wp setWaypointSpeed "FULL"; _group setCurrentWaypoint _wp; DYN_AI_VEHICLES_SPAWNED pushBack _vehicle; [_vehicle] spawn { params ["_v"]; sleep 600; if (alive _v) then { { deleteVehicle _x } forEach crew _v; deleteVehicle _v; DYN_AI_VEHICLES_SPAWNED = DYN_AI_VEHICLES_SPAWNED - [_v]; }; }; _vehicle };
fnc_aiMonitor = {
while {DYN_AI_ACTIVE} do {
sleep DYN_AI_MONITOR_INTERVAL; if (!DYN_AI_ACTIVE) exitWith {};
private _totalEast = count (allUnits select {side _x == east && alive _x && !isPlayer _x});
if (_totalEast >= DYN_AI_MAX_UNITS) exitWith {};
DYN_AI_VEHICLES_SPAWNED = DYN_AI_VEHICLES_SPAWNED select { alive _x };
private _eu = allUnits select { side _x == east && alive _x && !isPlayer _x }; private _ec = count _eu;
private _eAir = vehicles select { alive _x && side _x == east && _x isKindOf "Air" }; private _eac = count _eAir;
private _enemies = allUnits select { alive _x && (side _x == west || side _x == resistance) }; private _enc = count _enemies;
private _tu = _enc + 5; if (_tu > DYN_AI_MAX_UNITS) then { _tu = DYN_AI_MAX_UNITS; }; if (_tu < DYN_AI_MIN_UNITS) then { _tu = DYN_AI_MIN_UNITS; };
if (_ec < _tu) then {
private _uts = _tu - _ec; if (_uts > 5) then { _uts = 5; };
private _sp = getPos player; private _ut = ["O_Soldier_AR_F","O_HeavyGunner_F","O_Soldier_GL_F","O_Sharpshooter_F","O_Soldier_AA_F","O_Soldier_SL_F","O_Soldier_TL_F","O_Soldier_A_F"];
private _rg = createGroup east; private _rpgCount = 0;
for "_i" from 1 to _uts do {
if (_rpgCount < 2) then { [_rg, _sp getPos [5 + random 30, random 360]] call fnc_createRPGBomber; _rpgCount = _rpgCount + 1; } else {
private _unitType = selectRandom _ut; private _unit = _rg createUnit [_unitType, _sp getPos [5 + random 30, random 360], [], 3, "FORM"];
_unit setSkill 0.95; _unit setUnitPos "AUTO"; _unit allowFleeing 0; _unit setBehaviour "COMBAT"; _unit setCombatMode "RED"; _unit setSpeedMode "FULL"; _unit setVariable ["DYN_AI_UNIT", true, true]; _unit setVariable ["DYN_SIDE", east, true];
private _weapons = weapons _unit; { private _mags = getArray (configFile >> "CfgWeapons" >> _x >> "magazines"); if (count _mags > 0) then { for "_j" from 1 to 4 do { _unit addMagazine (_mags select 0); }; }; } forEach _weapons;
_unit addMagazine "HandGrenade"; _unit addMagazine "SmokeShell"; _unit addItem "FirstAidKit";
};
};
_rg setBehaviour "COMBAT"; _rg setCombatMode "RED"; _rg setSpeedMode "FULL"; _rg setFormation "WEDGE";
private _enemy = [_rg] call fnc_findNearestEnemy;
if (!isNull _enemy) then { private _ep = getPos _enemy; private _wp = _rg addWaypoint [_ep, 0]; _wp setWaypointType "SAD"; _wp setWaypointBehaviour "COMBAT"; _wp setWaypointCombatMode "RED"; _wp setWaypointSpeed "FULL"; _rg setCurrentWaypoint _wp; { _x reveal [_enemy, 4]; _x doWatch _enemy; _x commandTarget _enemy; _x doMove _ep; } forEach units _rg; };
};
private _aiVehicles = vehicles select { alive _x && side _x == east && !(_x isKindOf "Air") && !(_x isKindOf "Quadbike") && !(_x isKindOf "Static") };
private _aiVehiclesCount = count _aiVehicles;
if (_aiVehiclesCount < 1 && !(_enc == 0)) then {
private _enemyTarget = objNull; private _minDist = 999999;
{ private _dist = player distance _x; if (_dist < _minDist) then { _minDist = _dist; _enemyTarget = _x; }; } forEach (allUnits select { alive _x && (side _x == west || side _x == resistance) });
if (!isNull _enemyTarget) then { private _enemyPos = getPos _enemyTarget; [_enemyPos] call fnc_spawnAIVehicle; };
};
if (_eac < DYN_AI_MAX_AIR) then {
for "_i" from 1 to (DYN_AI_MAX_AIR - _eac) do {
private _sp = getPos player; private _at = if (count DYN_F35_CLASSES > 0) then { selectRandom DYN_F35_CLASSES } else { selectRandom ["O_Heli_Attack_02_F","O_Plane_CAS_02_F"] }; private _isJet = _at isKindOf "Plane";
private _spa = _sp getPos [1500 + random 500, random 360]; if (_isJet) then { _spa set [2, 1000] } else { _spa set [2, 300] };
private _veh = createVehicle [_at, _spa, [], 0, "FLY"]; _veh setVehicleAmmo 1; _veh setFuel 1; _veh setDamage 0; _veh setVariable ["DYN_SIDE", east, true];
if (count DYN_F35_CLASSES > 0 && {_at in DYN_F35_CLASSES}) then { [_veh] call fnc_applyF35Loadout; };
if (_isJet) then { _veh flyInHeight 500 + random 300 } else { _veh flyInHeight 150 + random 100 };
private _cg = createGroup east; private _dr = _cg createUnit ["O_Soldier_F", getPos _veh, [], 0, "FORM"]; _dr moveInDriver _veh; private _gn = _cg createUnit ["O_Soldier_F", getPos _veh, [], 0, "FORM"]; _gn moveInGunner _veh; private _cm = _cg createUnit ["O_Soldier_F", getPos _veh, [], 0, "FORM"]; _cm moveInCommander _veh;
_cg setBehaviour "COMBAT"; _cg setCombatMode "RED"; _cg setSpeedMode "FULL";
private _enemy = [_dr] call fnc_findNearestEnemy;
if (!isNull _enemy) then { private _ep = getPos _enemy; private _wp = _cg addWaypoint [_ep, 0]; _wp setWaypointType "SAD"; _wp setWaypointBehaviour "COMBAT"; _wp setWaypointCombatMode "RED"; _wp setWaypointSpeed "FULL"; _cg setCurrentWaypoint _wp; };
};
};
};
};
fnc_activateAI = { if (DYN_AI_ACTIVE) exitWith { hint "ИИ уже активен!" }; DYN_AI_ACTIVE = true; DYN_AI_COMMAND_ACTIVE = true; DYN_AI_ARTILLERY_ACTIVE = true; [] spawn fnc_spawnInitialAISquad; DYN_AI_THREADS pushBack ([] spawn fnc_aiMonitor); DYN_AI_THREADS pushBack ([] spawn fnc_aiArtilleryLoop); DYN_AI_THREADS pushBack ([] spawn fnc_aiCommandLoop); DYN_AI_THREADS pushBack ([] spawn fnc_aiTurretLoop); DYN_AI_THREADS pushBack ([] spawn fnc_aiParadropLoop); DYN_AI_THREADS pushBack ([] spawn fnc_aiKamikazeLoop); DYN_AI_THREADS pushBack ([] spawn fnc_aiWoundedLoop); DYN_AI_THREADS pushBack ([] spawn fnc_aiTargetWounded); DYN_AI_THREADS pushBack ([] spawn fnc_aiTacticalLoop); DYN_AI_THREADS pushBack ([] spawn fnc_aiRPGUsage); hint "ИИ активирован!"; call fnc_closeMainMenu; };
fnc_deactivateAI = { DYN_AI_ACTIVE = false; DYN_AI_ARTILLERY_ACTIVE = false; DYN_AI_COMMAND_ACTIVE = false; call fnc_closeMainMenu; };
fnc_spawnInitialAISquad = {
private _sp = getPos player; private _ag = createGroup east;
for "_i" from 1 to 8 do { [_ag, _sp getPos [5 + random 40, random 360]] call fnc_createRPGBomber; };
for "_i" from 1 to 12 do {
private _ut = selectRandom ["O_Soldier_AR_F","O_HeavyGunner_F","O_Soldier_GL_F","O_Sharpshooter_F","O_Soldier_AA_F","O_Soldier_SL_F","O_Soldier_TL_F","O_Soldier_A_F"];
private _unit = _ag createUnit [_ut, _sp getPos [5 + random 40, random 360], [], 3, "FORM"];
_unit setSkill 0.95; _unit setUnitPos "AUTO"; _unit allowFleeing 0; _unit setBehaviour "COMBAT"; _unit setCombatMode "RED"; _unit setSpeedMode "FULL"; _unit setVariable ["DYN_AI_UNIT", true, true]; _unit setVariable ["DYN_SIDE", east, true];
private _weapons = weapons _unit; { private _mags = getArray (configFile >> "CfgWeapons" >> _x >> "magazines"); if (count _mags > 0) then { for "_j" from 1 to 4 do { _unit addMagazine (_mags select 0); }; }; } forEach _weapons;
_unit addMagazine "HandGrenade"; _unit addMagazine "SmokeShell"; _unit addItem "FirstAidKit";
};
_ag setBehaviour "COMBAT"; _ag setCombatMode "RED"; _ag setSpeedMode "FULL"; _ag setFormation "WEDGE";
};
fnc_aiCommandLoop = { DYN_AI_COMMAND_ACTIVE = true; while {DYN_AI_ACTIVE} do { sleep 120 + random 120; if (!DYN_AI_ACTIVE) exitWith {}; private _eu = allUnits select { side _x == east && alive _x && !isPlayer _x }; if (count _eu == 0) exitWith {}; { if (alive _x && !isPlayer _x) then { private _enemy = [_x] call fnc_findNearestEnemy; if (!isNull _enemy && side _enemy != east) then { private _ep = getPos _enemy; _x reveal [_enemy, 4]; _x doWatch _enemy; _x commandTarget _enemy; _x doMove _ep; _x setBehaviour "COMBAT"; _x setCombatMode "RED"; _x setSpeedMode "FULL"; [_x] call DYN_aiUseCover; }; }; } forEach _eu; private _ev = vehicles select { alive _x && side _x == east }; { if (alive _x) then { private _enemy = [_x] call fnc_findNearestEnemy; if (!isNull _enemy && side _enemy != east) then { private _ep = getPos _enemy; _x reveal [_enemy, 4]; _x doWatch _enemy; _x commandTarget _enemy; _x doMove _ep; }; }; } forEach _ev; }; };
fnc_aiArtilleryLoop = { DYN_AI_ARTILLERY_ACTIVE = true; while {DYN_AI_ACTIVE} do { sleep 90 + random 60; if (!DYN_AI_ACTIVE) exitWith {}; private _enemies = allUnits select { alive _x && (side _x == west || side _x == resistance) && !isPlayer _x }; if (count _enemies == 0) exitWith {}; private _eu = allUnits select { side _x == east && alive _x && !isPlayer _x }; if (count _eu == 0) exitWith {}; private _re = selectRandom _eu; private _enemy = [_re] call fnc_findNearestEnemy; if (!isNull _enemy && side _enemy != east) then { private _ep = getPos _enemy; private _accuracy = 40 + random 60; private _shellCount = 1 + floor(random
; private _maxDeviation = (100 - _accuracy) * 2; for "_i" from 1 to _shellCount do { private _deviation = random _maxDeviation; private _angle = random 360; private _sp = [(_ep select 0) + (_deviation * cos _angle), (_ep select 1) + (_deviation * sin _angle), 0]; "Sh_155mm_AMOS" createVehicle _sp; sleep (0.5 + random 0.5); }; }; }; };
fnc_aiTurretLoop = { while {DYN_AI_ACTIVE} do { sleep 120 + random 120; if (!DYN_AI_ACTIVE) exitWith {}; private _eu = allUnits select { side _x == east && alive _x && !isPlayer _x }; if (count _eu == 0) exitWith {}; private _enemy = [_eu select 0] call fnc_findNearestEnemy; if (!isNull _enemy && side _enemy != east) then { private _ep = getPos _enemy; private _eastUnit = _eu select 0; private _distToEnemy = _eastUnit distance _enemy; if (_distToEnemy < 500) then { private _tt = ["O_HMG_01_high_F","O_GMG_01_high_F","O_HMG_01_F","O_GMG_01_F"]; private _tType = selectRandom _tt; private _tPos = _eastUnit getPos [50 + random 100, random 360]; private _turret = createVehicle [_tType, _tPos, [], 0, "CAN_COLLIDE"]; _turret setDir random 360; _turret setVariable ["DYN_SIDE", east, true]; private _cg = createGroup east; private _gunner = _cg createUnit ["O_Soldier_AR_F", _tPos, [], 0, "FORM"]; _gunner moveInGunner _turret; _gunner setSkill 0.95; _gunner allowFleeing 0; _gunner setBehaviour "COMBAT"; _gunner setCombatMode "RED"; _cg setBehaviour "COMBAT"; _cg setCombatMode "RED"; DYN_SUPPORT_TURRETS pushBack _turret; [_turret, _gunner] spawn { params ["_turret","_gunner"]; sleep 600; if (!isNull _turret) then { if (alive _gunner) then { deleteVehicle _gunner; }; deleteVehicle _turret; DYN_SUPPORT_TURRETS = DYN_SUPPORT_TURRETS - [_turret]; }; }; }; }; }; };
fnc_aiParadropLoop = { while {DYN_AI_ACTIVE} do { sleep 300 + random 300; if (!DYN_AI_ACTIVE) exitWith {}; private _enemies = allUnits select { alive _x && (side _x == west || side _x == resistance) }; if (count _enemies == 0) exitWith {}; private _enemy = selectRandom _enemies; private _ep = getPos _enemy; private _dp = _ep getPos [500 + random 300, random 360]; private _pc = 8 + floor(random 5); private _ut = ["O_Soldier_AR_F","O_HeavyGunner_F","O_Soldier_GL_F","O_Sharpshooter_F","O_Soldier_AA_F","O_Soldier_SL_F"]; private _pg = createGroup east; for "_i" from 1 to _pc do { private _unitType = selectRandom _ut; private _unit = _pg createUnit [_unitType, _dp getPos [5 + random 20, random 360], [], 3, "FORM"]; _unit setSkill 0.95; _unit setUnitPos "AUTO"; _unit allowFleeing 0; _unit setBehaviour "COMBAT"; _unit setCombatMode "RED"; _unit setSpeedMode "FULL"; _unit setVariable ["DYN_AI_UNIT", true, true]; _unit setVariable ["DYN_SIDE", east, true]; private _weapons = weapons _unit; { private _mags = getArray (configFile >> "CfgWeapons" >> _x >> "magazines"); if (count _mags > 0) then { for "_j" from 1 to 4 do { _unit addMagazine (_mags select 0); }; }; } forEach _weapons; _unit addMagazine "HandGrenade"; _unit addMagazine "SmokeShell"; _unit addItem "FirstAidKit"; }; for "_i" from 1 to 3 do { [_pg, _dp getPos [random 30, random 360]] call fnc_createRPGBomber; }; _pg setBehaviour "COMBAT"; _pg setCombatMode "RED"; _pg setSpeedMode "FULL"; _pg setFormation "WEDGE"; private _ep2 = getPos _enemy; private _wp = _pg addWaypoint [_ep2, 0]; _wp setWaypointType "SAD"; _wp setWaypointBehaviour "COMBAT"; _wp setWaypointCombatMode "RED"; _wp setWaypointSpeed "FULL"; _pg setCurrentWaypoint _wp; { _x reveal [_enemy, 4]; _x doWatch _enemy; _x commandTarget _enemy; _x doMove _ep2; } forEach units _pg; }; };
fnc_aiWoundedLoop = { while {DYN_AI_ACTIVE} do { sleep 120; if (!DYN_AI_ACTIVE) exitWith {}; private _eu = allUnits select { side _x == east && alive _x && !isPlayer _x }; { if (alive _x && !isPlayer _x) then { private _damage = damage _x; if (_damage > 0.3) then { private _wt = _x getVariable ["DYN_WOUNDED_TIME", -1]; if (_wt == -1) then { _x setVariable ["DYN_WOUNDED_TIME", time, true]; DYN_WOUNDED_UNITS pushBack _x; } else { private _wd = time - _wt; if (_wd > 600) then { if (count crew _x > 0) then { { deleteVehicle _x } forEach crew _x; }; deleteVehicle _x; DYN_WOUNDED_UNITS = DYN_WOUNDED_UNITS - [_x]; }; }; }; }; } forEach _eu; }; };
fnc_aiTargetWounded = { while {DYN_AI_ACTIVE} do { sleep 60; if (!DYN_AI_ACTIVE) exitWith {}; private _eu = allUnits select { side _x == east && alive _x && !isPlayer _x }; private _ww = allUnits select { (side _x == west || side _x == resistance) && alive _x && damage _x > 0.3 }; if (count _ww == 0) exitWith {}; { private _eastUnit = _x; if (alive _eastUnit && !isPlayer _eastUnit) then { private _nw = objNull; private _md = 999999; { private _dist = _eastUnit distance _x; if (_dist < _md) then { _md = _dist; _nw = _x; }; } forEach _ww; if (!isNull _nw) then { _eastUnit reveal [_nw, 4]; _eastUnit doWatch _nw; _eastUnit commandTarget _nw; _eastUnit doMove (getPos _nw); _eastUnit setBehaviour "COMBAT"; _eastUnit setCombatMode "RED"; _eastUnit setSpeedMode "FULL"; }; }; } forEach _eu; }; };
fnc_aiKamikazeLoop = { while {DYN_AI_ACTIVE} do { sleep 300 + random 300; if (!DYN_AI_ACTIVE) exitWith {}; private _enemies = allUnits select { (side _x == west || side _x == resistance) && alive _x }; if (count _enemies == 0) exitWith {}; private _enemy = selectRandom _enemies; private _ep = getPos _enemy; private _sp = _ep getPos [500 + random 300, random 360]; _sp set [2, 200]; private _dt = selectRandom DYN_KAMIKAZE_DRONE_TYPES; private _drone = createVehicle [_dt, _sp, [], 0, "FLY"]; _drone setDir random 360; _drone setVehicleAmmo 1; _drone setFuel 1; _drone setDamage 0; _drone setVariable ["DYN_SIDE", east, true]; _drone setVariable ["DYN_KAMIKAZE_DRONE", true, true]; DYN_KAMIKAZE_DRONES pushBack _drone; private _cg = createGroup east; private _dr = _cg createUnit ["O_Soldier_F", getPos _drone, [], 0, "FORM"]; _dr moveInDriver _drone; _cg setBehaviour "COMBAT"; _cg setCombatMode "RED"; _cg setSpeedMode "FULL"; [_drone, _ep] spawn { params ["_drone","_ep"]; while {alive _drone} do { sleep 2; private _enemies = allUnits select { (side _x == west || side _x == resistance) && alive _x }; if (count _enemies == 0) exitWith {}; private _ne = objNull; private _md = 999999; { private _dist = _drone distance _x; if (_dist < _md) then { _md = _dist; _ne = _x; }; } forEach _enemies; if (!isNull _ne) then { private _nep = getPos _ne; _drone doMove _nep; _drone doWatch _ne; _drone commandTarget _ne; if (_drone distance _ne < 20) then { "HelicopterExploBig" createVehicle (getPos _drone); private _au = allUnits select { _x distance (getPos _drone) < 30 && alive _x && (side _x == west || side _x == resistance) }; { private _dm = 0.8 + random 0.5; _x setDamage ((damage _x) + _dm); } forEach _au; if (count crew _drone > 0) then { { deleteVehicle _x } forEach crew _drone; }; deleteVehicle _drone; DYN_KAMIKAZE_DRONES = DYN_KAMIKAZE_DRONES - [_drone]; }; }; }; }; }; };
DYN_aiTacticalRetreat = { params ["_group"]; if (isNull _group) exitWith {}; private _units = units _group; private _aliveUnits = _units select { alive _x }; private _totalUnits = count _units; private _aliveCount = count _aliveUnits; if (_totalUnits == 0) exitWith {}; private _lossPercent = ((_totalUnits - _aliveCount) / _totalUnits) * 100; if (_lossPercent >= 50 && _aliveCount > 0) then { private _safePos = (getPos player) getPos [200 + random 200, random 360]; { if (alive _x) then { _x doMove _safePos; _x setBehaviour "CARELESS"; _x setSpeedMode "FULL"; _x setCombatMode "BLUE"; }; } forEach _aliveUnits; }; };
DYN_aiCoordinatedAttack = { params ["_targetPos"]; [_targetPos] spawn { params ["_targetPos"]; private _infantryGroups = allGroups select { side _x == east && {count (units _x select {alive _x}) > 0} && {!isNull (leader _x)} && {alive (leader _x)} }; private _vehicles = vehicles select { alive _x && side _x == east && !(_x isKindOf "Air") }; private _airUnits = vehicles select { alive _x && side _x == east && _x isKindOf "Air" }; if (count _infantryGroups == 0) exitWith { hint "Нет доступных групп!" }; systemChat " КООРДИНИРОВАННАЯ АТАКА!"; { private _grp = _x; private _wp = _grp addWaypoint [_targetPos, 50]; _wp setWaypointType "SAD"; _wp setWaypointBehaviour "COMBAT"; _wp setWaypointCombatMode "RED"; _wp setWaypointSpeed "FULL"; _grp setCurrentWaypoint _wp; { _x doMove _targetPos; _x setBehaviour "COMBAT"; _x setCombatMode "RED"; } forEach (units _grp select {alive _x}); } forEach _infantryGroups; sleep 3; { if (alive _x) then { private _sp = _targetPos getPos [80 + random 40, random 360]; _x doMove _sp; { _x doWatch _targetPos; } forEach crew _x; }; } forEach _vehicles; sleep 2; { if (alive _x) then { private _ap = _targetPos getPos [150, random 360]; _ap set [2, 80 + random 40]; _x doMove _ap; { _x doWatch _targetPos; } forEach crew _x; }; } forEach _airUnits; }; };
DYN_aiSendScout = { params ["_targetArea"]; [_targetArea] spawn { params ["_targetArea"]; private _scoutTypes = ["O_recon_F","O_recon_LAT_F","O_recon_medic_F"]; private _scoutType = selectRandom _scoutTypes; private _scoutPos = _targetArea getPos [300 + random 200, random 360]; private _scoutGroup = createGroup east; private _scout = _scoutGroup createUnit [_scoutType, _scoutPos, [], 0, "FORM"]; _scout setSkill 0.9; _scout setUnitPos "AUTO"; _scout setBehaviour "STEALTH"; _scout setCombatMode "GREEN"; _scout setSpeedMode "LIMITED"; _scout doMove _targetArea; _scout doWatch _targetArea; sleep 30; if (alive _scout) then { deleteVehicle _scout; }; }; };
DYN_aiUseCover = { params ["_unit"]; if (isNull _unit || !alive _unit) exitWith {}; private _nearestEnemy = [_unit] call fnc_findNearestEnemy; if (isNull _nearestEnemy) exitWith {}; private _distance = _unit distance _nearestEnemy; if (_distance < 200 && _distance > 30) then { _unit setUnitPos "DOWN"; _unit doWatch _nearestEnemy; private _coverObjects = nearestObjects [_unit, ["Land_Wall_Tin_4","Land_Wall_TinCom_1_1","Land_HBarrier_5_F","Land_BagFence_Long_F"], 20]; if (count _coverObjects > 0) then { private _cover = _coverObjects select 0; _unit doMove (getPos _cover); }; }; };
fnc_aiTacticalLoop = { while {DYN_AI_ACTIVE} do { sleep 90; if (!DYN_AI_ACTIVE) exitWith {}; private _allEnemies = allUnits select { alive _x && (side _x == west || side _x == resistance) && !isPlayer _x }; if (count _allEnemies > 10) then { private _re = selectRandom _allEnemies; private _cp = getPos _re; private _ne = _allEnemies select { (_x distance _cp) < 100 }; if (count _ne >= 5) then { [_cp] spawn DYN_aiSendScout; }; }; private _grps = allGroups select { side _x == east }; { [_x] call DYN_aiTacticalRetreat; } forEach _grps; }; };
// ================ ГРАФИЧЕСКОЕ МЕНЮ ================
fnc_guiCreateButton = { params ["_d","_t","_x","_y","_w","_h","_c","_col"]; if (isNil "_col") then { _col = [0, 0, 0, 0.95] }; private _b = _d ctrlCreate ["RscButton", -1]; _b ctrlSetPosition [_x, _y, _w, _h]; _b ctrlSetText _t; _b ctrlSetBackgroundColor _col; _b ctrlSetForegroundColor [1, 1, 1, 1]; _b ctrlCommit 0; if (!isNil "_c") then { _b ctrlAddEventHandler ["ButtonClick", _c] }; DYN_GUI_CONTENT pushBack _b; _b; };
fnc_guiCreatePersistent = { params ["_d","_t","_x","_y","_w","_h","_tx","_col"]; if (isNil "_col") then { _col = [0, 0, 0, 0.95] }; private _c = _d ctrlCreate [_t, -1]; _c ctrlSetPosition [_x, _y, _w, _h]; if (_t == "RscStructuredText") then { _c ctrlSetStructuredText parseText _tx; } else { _c ctrlSetText _tx; }; _c ctrlSetBackgroundColor _col; _c ctrlCommit 0; DYN_GUI_PERSISTENT pushBack _c; _c; };
fnc_guiCreateText = { params ["_d","_t","_x","_y","_w","_h","_col","_sz"]; if (isNil "_col") then { _col = [1, 1, 1, 1] }; if (isNil "_sz") then { _sz = 0.035 }; private _tx = _d ctrlCreate ["RscText", -1]; _tx ctrlSetPosition [_x, _y, _w, _h]; _tx ctrlSetText _t; _tx ctrlSetTextColor _col; _tx ctrlSetFontHeight _sz; _tx ctrlCommit 0; DYN_GUI_CONTENT pushBack _tx; _tx; };
fnc_guiClearContent = { { ctrlDelete _x; } forEach DYN_GUI_CONTENT; DYN_GUI_CONTENT = []; };
fnc_guiHighlightTab = { params ["_ti"]; { if (_forEachIndex == _ti) then { _x ctrlSetBackgroundColor [0.3, 0.2, 0.1, 1]; } else { _x ctrlSetBackgroundColor [0.15, 0.15, 0.15, 0.9]; }; } forEach DYN_GUI_TABS; };
fnc_openMainMenu = {
if (DYN_ARSENAL_OPEN || DYN_GUI_OPEN) exitWith {};
private _mainDisplay = findDisplay 46; if (isNull _mainDisplay) exitWith { hint "Дисплей не найден!" };
private _d = _mainDisplay createDisplay "RscDisplayEmpty"; if (isNull _d) exitWith { hint "Меню не создано!" };
uiNamespace setVariable ["DYN_GUI_Display", _d]; DYN_GUI_OPEN = true; DYN_GUI_PERSISTENT = []; DYN_GUI_CONTENT = []; DYN_GUI_TABS = [];
private _wx = 0.05; private _wy = 0.04; private _ww = 0.90; private _wh = 0.94;
[_d, "RscText", _wx, _wy, _ww, _wh, "", [0, 0, 0, 0.95]] call fnc_guiCreatePersistent;
[_d, "RscStructuredText", _wx, _wy, _ww, 0.05, "<t align='center' size='1.1' color='#FFFFFF'>ГЛАВНОЕ МЕНЮ v19.19</t>", [0.2, 0.2, 0.2, 0.95]] call fnc_guiCreatePersistent;
private _ty = _wy + 0.055; private _th = 0.04; private _tw = _ww / 9;
private _tn = ["БОЙ","СНАРЯЖЕНИЕ","ИНЖЕНЕР","ДРОНЫ","RTS","ТЕХНИКА","УДАРЫ","ИИ","СТАТЫ"];
private _tc = [{ call fnc_guiShowTabCombat; },{ call fnc_guiShowTabGear; },{ call fnc_guiShowTabEngineer; },{ call fnc_guiShowTabDrones; },{ call fnc_guiShowTabRTS; },{ call fnc_guiShowTabSmartVehicle; },{ call fnc_guiShowTabStrikes; },{ call fnc_guiShowTabAI; },{ call fnc_guiShowTabStats; }];
for "_i" from 0 to 8 do { private _tab = _d ctrlCreate ["RscButton", -1]; _tab ctrlSetPosition [_wx + (_tw*_i), _ty, _tw, _th]; _tab ctrlSetText (_tn select _i); _tab ctrlSetBackgroundColor [0.15, 0.15, 0.15, 0.9]; _tab ctrlSetForegroundColor [1, 1, 1, 1]; _tab ctrlCommit 0; _tab ctrlAddEventHandler ["ButtonClick", (_tc select _i)]; DYN_GUI_TABS pushBack _tab; DYN_GUI_PERSISTENT pushBack _tab; };
private _cb = _d ctrlCreate ["RscButton", -1]; _cb ctrlSetPosition [_wx + 0.02, _wy + _wh - 0.05, _ww - 0.04, 0.04]; _cb ctrlSetText "ЗАКРЫТЬ МЕНЮ"; _cb ctrlSetBackgroundColor [0.3, 0.1, 0.1, 0.9]; _cb ctrlSetForegroundColor [1, 1, 1, 1]; _cb ctrlCommit 0; _cb ctrlAddEventHandler ["ButtonClick", { call fnc_closeMainMenu; }]; DYN_GUI_PERSISTENT pushBack _cb;
_d displayAddEventHandler ["KeyDown", { params ["_d","_k"]; if (_k == 1 || _k == 22) then { call fnc_closeMainMenu; true } else { false }; }];
call fnc_guiShowTabCombat;
};
fnc_closeMainMenu = { if (!DYN_GUI_OPEN) exitWith {}; private _d = uiNamespace getVariable ["DYN_GUI_Display", displayNull]; if (!isNull _d) then { _d closeDisplay 2; }; uiNamespace setVariable ["DYN_GUI_Display", nil]; DYN_GUI_OPEN = false; DYN_GUI_PERSISTENT = []; DYN_GUI_CONTENT = []; DYN_GUI_TABS = []; DYN_GUI_CURRENT_TAB = ""; };
// ================ ВКЛАДКИ МЕНЮ ================
fnc_guiShowTabCombat = { call fnc_guiClearContent; [0] call fnc_guiHighlightTab; DYN_GUI_CURRENT_TAB = "combat"; private _d = uiNamespace getVariable ["DYN_GUI_Display", displayNull]; if (isNull _d) exitWith {}; private _bx=0.40; private _bw=0.56; private _bh=0.028; private _g=0.003; private _y=0.155; [_d, "УПРАВЛЕНИЕ БОЕМ", _bx, _y, _bw, 0.03, [1,0.8,0,1], 0.04] call fnc_guiCreateText; _y = _y + 0.035;
[_d, " 3 СУПЕР-СОЛДАТА (Бессмертные)", _bx, _y, _bw, _bh, { call fnc_spawnSuperSoldiers; }, [0.5,0.1,0.5,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, "✈ F-35 LIGHTNING II (5000м)", _bx, _y, _bw, _bh, { call fnc_guiShowAircraftMenu; }, [0,0.5,1,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, "✈ ШТУРМОВИК (114 НАР)", _bx, _y, _bw, _bh, { call fnc_spawnAttackPlane; }, [0.2,0.5,0.8,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, " МЕГАДРОН (Кассетный)", _bx, _y, _bw, _bh, { call fnc_spawnFuturisticDrone; }, [0.8,0.2,0.8,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, " АРТИЛЛЕРИЯ (САУ)", _bx, _y, _bw, _bh, { call fnc_spawnArtillery; }, [0.8,0.4,0,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, " СПЕЦОТРЯД (Умный)", _bx, _y, _bw, _bh, { call fnc_spawnSpecOpsSquad; }, [0.1,0.4,0.1,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, " ЭЛИТНЫЙ СПЕЦНАЗ (10)", _bx, _y, _bw, _bh, { call fnc_spawnSupportGroup; }, [0.4,0.1,0.4,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, "⚔ ПРИКАЗ АТАКИ ВСЕМ (ВКЛ/ВЫКЛ)", _bx, _y, _bw, _bh, { call fnc_toggleGlobalAttack; }, [0.7,0.3,0,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, " УДАЛИТЬ ВСЕХ ВОСТОЧНЫХ", _bx, _y, _bw, _bh, { call fnc_deleteAllEast; }, [0.5,0.1,0.1,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g*2;
[_d, " ТЕЛЕПОРТ ПО КАРТЕ", _bx, _y, _bw, _bh, { call fnc_teleportPlayer; call fnc_closeMainMenu; }, [0,0.4,0.7,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, "⚡ ТЕЛЕПОРТ ВСЕХ ВОСТОЧНЫХ", _bx, _y, _bw, _bh, { call fnc_teleportAllEastToMapPoint; call fnc_closeMainMenu; }, [0,0.6,0.3,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, " КВАДРОЦИКЛ 350 КМ/Ч", _bx, _y, _bw, _bh, { call fnc_toggleQuadbikeBoost; }, [0,0.6,0.3,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, " ПОДКРЕПЛЕНИЕ (14+6РПГ+танк)", _bx, _y, _bw, _bh, { call fnc_callReinforcement; }, [0,0,0,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, " ТАНК ОТДЕЛЬНО", _bx, _y, _bw, _bh, { call fnc_callTank; }, [0,0,0,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, " ПРИСОЕДИНИТЬ ВСЕХ ВОСТОЧНЫХ", _bx, _y, _bw, _bh, { call fnc_joinAllEastToPlayer; }, [0,0,0,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g*2;
[_d, "СИСТЕМЫ", _bx, _y, _bw, 0.03, [1,0.8,0,1], 0.04] call fnc_guiCreateText; _y = _y + 0.035;
[_d, " СКАНЕР (ВКЛ/ВЫКЛ)", _bx, _y, _bw, _bh, { call fnc_toggleEnemyScanner; }, [0,0,0,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, " ГЛОБАЛЬНЫЙ РАДАР (Карта)", _bx, _y, _bw, _bh, { call fnc_toggleGlobalRadar; }, [0,0.5,0.5,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, "♻ ВОЗРОЖДЕНИЕ (ВКЛ/ВЫКЛ)", _bx, _y, _bw, _bh, { call fnc_toggleRespawnSystem; }, [0,0,0,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, " СЧЁТЧИК ПАТРОНОВ", _bx, _y, _bw, _bh, { call fnc_toggleAmmoCounter; }, [0.2,0.5,0.6,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, " ПОПОЛНИТЬ БОЕПРИПАСЫ", _bx, _y, _bw, _bh, { call fnc_refillAmmo; }, [0,0,0,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, " ПЕРЕКЛЮЧИТЬСЯ НА ВОСТОЧНОГО", _bx, _y, _bw, _bh, { call fnc_showMapForSwitch; call fnc_closeMainMenu; }, [0,0,0,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, "↩ ВЕРНУТЬСЯ К ОСНОВНОМУ", _bx, _y, _bw, _bh, { call fnc_returnToMainPlayer; }, [0.2,0.6,0.2,0.95]] call fnc_guiCreateButton;
};
fnc_guiShowTabGear = { call fnc_guiClearContent; [1] call fnc_guiHighlightTab; DYN_GUI_CURRENT_TAB = "gear"; private _d = uiNamespace getVariable ["DYN_GUI_Display", displayNull]; if (isNull _d) exitWith {}; private _bx=0.40; private _bw=0.56; private _bh=0.028; private _g=0.002; private _y=0.155; [_d, "АРСЕНАЛ", _bx, _y, _bw, 0.025, [1,0.8,0,1], 0.032] call fnc_guiCreateText; _y = _y + 0.028;
[_d, " ОТКРЫТЬ АРСЕНАЛ", _bx, _y, _bw, 0.035, { call fnc_openArsenal; }, [0,0,0,0.95]] call fnc_guiCreateButton; _y = _y + 0.038;
[_d, " БАЗОВАЯ ЭКИПИРОВКА (Тактическая)", _bx, _y, _bw, 0.035, { [player] call fnc_equipStandardLoadout; }, [0,0.4,0.6,0.95]] call fnc_guiCreateButton; _y = _y + 0.04;
[_d, "ГОТОВЫЕ КОМПЛЕКТЫ", _bx, _y, _bw, 0.025, [1,0.8,0,1], 0.032] call fnc_guiCreateText; _y = _y + 0.028;
[_d, " ПУЛЕМЁТЧИК", _bx, _y, _bw, _bh, { ["MACHINEGUNNER"] call fnc_applyPresetLoadout; }, [0.1,0.3,0.1,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, " СНАЙПЕР", _bx, _y, _bw, _bh, { ["SNIPER"] call fnc_applyPresetLoadout; }, [0.1,0.2,0.3,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, " ДИВЕРСАНТ", _bx, _y, _bw, _bh, { ["STEALTH"] call fnc_applyPresetLoadout; }, [0.2,0.1,0.3,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g*3;
[_d, "СОХРАНИТЬ НАБОР", _bx, _y, _bw, 0.025, [1,0.8,0,1], 0.028] call fnc_guiCreateText; _y = _y + 0.028;
for "_i" from 1 to 5 do { private _s = _i; private _c = compile format ["[%1] call fnc_saveLoadout;", _s]; private _sw = _bw/5 - 0.002; private _sx = _bx + ((_i-1)*(_sw+0.002)); [_d, format ["%1", _s], _sx, _y, _sw, _bh, _c, [0,0,0,0.95]] call fnc_guiCreateButton; }; _y = _y + _bh + _g*3;
[_d, "ЗАГРУЗИТЬ НАБОР", _bx, _y, _bw, 0.025, [1,0.8,0,1], 0.028] call fnc_guiCreateText; _y = _y + 0.028;
for "_i" from 1 to 5 do { private _s = _i; private _c = compile format ["[%1] call fnc_loadLoadout;", _s]; private _sw = _bw/5 - 0.002; private _sx = _bx + ((_i-1)*(_sw+0.002)); [_d, format ["%1", _s], _sx, _y, _sw, _bh, _c, [0,0,0,0.95]] call fnc_guiCreateButton; }; _y = _y + _bh + _g*3;
[_d, "УДАЛИТЬ НАБОР", _bx, _y, _bw, 0.025, [1,0.8,0,1], 0.028] call fnc_guiCreateText; _y = _y + 0.028;
for "_i" from 1 to 5 do { private _s = _i; private _c = compile format ["[%1] call fnc_deleteLoadout;", _s]; private _sw = _bw/5 - 0.002; private _sx = _bx + ((_i-1)*(_sw+0.002)); [_d, format ["%1", _s], _sx, _y, _sw, _bh, _c, [0,0,0,0.95]] call fnc_guiCreateButton; };
};
fnc_guiShowTabEngineer = { call fnc_guiClearContent; [2] call fnc_guiHighlightTab; DYN_GUI_CURRENT_TAB = "engineer"; private _d = uiNamespace getVariable ["DYN_GUI_Display", displayNull]; if (isNull _d) exitWith {}; private _bx=0.40; private _bw=0.56; private _bh=0.045; private _g=0.006; private _y=0.155; [_d, "ИНЖЕНЕРНЫЕ РАБОТЫ", _bx, _y, _bw, 0.03, [1,0.8,0,1], 0.04] call fnc_guiCreateText; _y = _y + 0.04;
[_d, " УСТАНОВИТЬ ТУРЕЛЬ", _bx, _y, _bw, _bh, { call fnc_guiShowTurretMenu; }, [0,0,0,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, " ПОСТРОИТЬ УКРЕПЛЕНИЕ", _bx, _y, _bw, _bh, { call fnc_guiShowFortMenu; }, [0,0,0,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, " СОЗДАТЬ КВАДРОЦИКЛ", _bx, _y, _bw, _bh, { call fnc_spawnQuadbike; }, [0,0,0,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, " AGS-30", _bx, _y, _bw, _bh, { call fnc_spawnAGSCannon; }, [0.6,0.3,0,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, " МИНОМЁТ", _bx, _y, _bw, _bh, { call fnc_spawnMortar; }, [0.6,0.3,0,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g;
[_d, " ПВО 'ШИЛКА'", _bx, _y, _bw, _bh, { call fnc_spawnAAVehicle; }, [0,0.5,0.5,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g*2;
[_d, "Объект появится перед вами", _bx, _y, _bw, 0.025, [1,1,1,1], 0.028] call fnc_guiCreateText;
};
fnc_guiShowTurretMenu = { call fnc_guiClearContent; private _d = uiNamespace getVariable ["DYN_GUI_Display", displayNull]; if (isNull _d) exitWith {}; private _bx=0.40; private _bw=0.56; private _bh=0.04; private _g=0.005; private _y=0.155; [_d, "ВЫБОР ТУРЕЛИ", _bx, _y, _bw, 0.03, [1,0.8,0,1], 0.04] call fnc_guiCreateText; _y = _y + 0.04; { _x params ["_c","_l"]; private _cd = compile format ["['%1', '%2'] call fnc_spawnTurret;", _c, _l]; [_d, _l, _bx, _y, _bw, _bh, _cd, [0,0,0,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g; } forEach DYN_TURRET_TYPES; _y = _y + _g*3; [_d, "↩ НАЗАД", _bx, _y, _bw, _bh, { call fnc_guiShowTabEngineer; }, [0,0,0,0.95]] call fnc_guiCreateButton; };
fnc_guiShowFortMenu = { call fnc_guiClearContent; private _d = uiNamespace getVariable ["DYN_GUI_Display", displayNull]; if (isNull _d) exitWith {}; private _bx=0.40; private _bw=0.56; private _bh=0.038; private _g=0.004; private _y=0.155; [_d, "ВЫБОР УКРЕПЛЕНИЯ", _bx, _y, _bw, 0.03, [1,0.8,0,1], 0.04] call fnc_guiCreateText; _y = _y + 0.04; { _x params ["_c","_l"]; private _cd = compile format ["['%1', '%2'] call fnc_spawnFort;", _c, _l]; [_d, _l, _bx, _y, _bw, _bh, _cd, [0,0,0,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g; } forEach DYN_FORT_TYPES; _y = _y + _g*3; [_d, "↩ НАЗАД", _bx, _y, _bw, 0.045, { call fnc_guiShowTabEngineer; }, [0,0,0,0.95]] call fnc_guiCreateButton; };
fnc_guiShowTabDrones = { call fnc_guiClearContent; [3] call fnc_guiHighlightTab; DYN_GUI_CURRENT_TAB = "drones"; private _d = uiNamespace getVariable ["DYN_GUI_Display", displayNull]; if (isNull _d) exitWith {}; private _bx=0.40; private _bw=0.175; private _bh=0.035; private _gx=0.015; private _gy=0.005; private _y=0.155; private _col=0; [_d, "УПРАВЛЕНИЕ ДРОНАМИ (ТОЛЬКО ВОСТОК)", _bx, _y-0.04, _bw*3+_gx*2, 0.03, [1,0.8,0,1], 0.04] call fnc_guiCreateText; { _x params ["_text","_class"]; private _xp = _bx + (_col*(_bw+_gx)); private _cd = compile ("[player, '" + _class + "'] call DRONE_spawnStandardDrone;"); [_d, _text, _xp, _y, _bw, _bh, _cd, [0,0,0,0.95]] call fnc_guiCreateButton; _col = _col + 1; if (_col >= 3) then { _col = 0; _y = _y + _bh + _gy; }; } forEach [["WASP AR-86","WNZ_AR86_Wasp_O"],["CUSTODIAN UCAV","WNZ_UCAV_130_Custodian_105mm_O"],["MQ-14","O_WNZ_MQ14"],["MQ-11","O_WNZ_MQ11"],["MQ-13","O_WNZ_MQ13"],["MQ-15","O_WNZ_MQ15"],["GREYHAWK","O_UAV_02_dynamicLoadout_F"],["GUARDIAN AA","WNZ_UCAV_Guardian_AA_O"],["CROCUS AP","O_Crocus_AP"],["CROCUS AT","O_Crocus_AT"],["WASP AR-81","WNZ_AR81_Wasp_O"],["HE DRONE","HE_drone_Opfor"],["MAVIK 3T","mavik_3T_OPF"],["STALKER UGV","WNZ_UGV_32_Stalker_O"],["HUNTER UGV","WNZ_UGV_31_Hunter_O"],["SPOTTER UGV","WNZ_UGV_36_Spotter_O"],["DEMINING UGV","O_UGV_02_Demining_F"],["SNIPER UGV","O_UGV_02_Sniper_F"]]; _col = 0; _y = _y + _bh + _gy*2; [_d, " АВТОПИЛОТ: ПОИСК И УНИЧТОЖЕНИЕ", _bx, _y, _bw*2+_gx, _bh, { call DRONE_searchAndDestroy; }, [0.8,0.2,0,0.95]] call fnc_guiCreateButton; _col = 2; [_d, "↩ ВЕРНУТЬСЯ", _bx + _col*(_bw+_gx), _y, _bw, _bh, { call DRONE_returnToPlayer; }, [0.2,0.6,0.2,0.95]] call fnc_guiCreateButton; _col = 0; _y = _y + _bh + _gy; [_d, " УСКОРЕНИЕ ДРОНА 600", _bx, _y, _bw, _bh, { call fnc_toggleDroneBoost; }, [0,0.5,0.8,0.95]] call fnc_guiCreateButton; _col = 1; [_d, " КВАДРОЦИКЛ 350 КМ/Ч", _bx + _col*(_bw+_gx), _y, _bw, _bh, { call fnc_toggleQuadbikeBoost; }, [0,0.6,0.3,0.95]] call fnc_guiCreateButton; _col = 2; [_d, " УДАЛИТЬ ВСЕХ", _bx + _col*(_bw+_gx), _y, _bw, _bh, { call DRONE_deleteAllDrones; }, [0.3,0.1,0.1,0.95]] call fnc_guiCreateButton; _col = 0; _y = _y + _bh + _gy; [_d, " УМНАЯ РАКЕТА", _bx, _y, _bw, _bh, { call fnc_callSmartMissileStrike; }, [0.6,0.1,0.1,0.95]] call fnc_guiCreateButton; _col = 1; [_d, " АВИА РАКЕТА", _bx + _col*(_bw+_gx), _y, _bw, _bh, { call fnc_aviationRocketStrikeAtMap; }, [0.5,0.4,0.1,0.95]] call fnc_guiCreateButton; _col = 2; [_d, " ВЫСОТА 1000м", _bx + _col*(_bw+_gx), _y, _bw, _bh, { [1000] call DRONE_setAltitude; }, [0,0,0,0.95]] call fnc_guiCreateButton; _col = 0; _y = _y + _bh + _gy; [_d, " МЕДИЦИНСКИЕ ДРОНЫ", _bx, _y, _bw*3+_gx*2, _bh, { call fnc_activateMedDrones; }, [0,0.6,0.6,0.95]] call fnc_guiCreateButton; _col = 0; _y = _y + _bh + _gy; [_d, " НАЗЕМНЫЕ ДРОНЫ-УБИЙЦЫ (3 шт)", _bx, _y, _bw*3+_gx*2, _bh, { call fnc_spawnGroundKillerDrones; }, [0.6,0.2,0,0.95]] call fnc_guiCreateButton; };
fnc_guiShowTabRTS = { call fnc_guiClearContent; [4] call fnc_guiHighlightTab; DYN_GUI_CURRENT_TAB = "rts"; private _d = uiNamespace getVariable ["DYN_GUI_Display", displayNull]; if (isNull _d) exitWith {}; private _bx=0.40; private _bw=0.56; private _bh=0.055; private _g=0.01; private _y=0.155; [_d, "RTS УПРАВЛЕНИЕ ВОСТОКОМ", _bx, _y, _bw, 0.03, [1,0.8,0,1], 0.04] call fnc_guiCreateText; _y = _y + 0.04; [_d, format ["Восточных юнитов: %1", count (allUnits select { side _x == east && alive _x && !isPlayer _x })], _bx, _y, _bw, 0.025, [1,1,1,1], 0.028] call fnc_guiCreateText; _y = _y + 0.028; [_d, format ["Выделено: %1", count DYN_RTS_selectedUnits], _bx, _y, _bw, 0.025, [1,1,1,1], 0.028] call fnc_guiCreateText; _y = _y + 0.04; [_d, " ВЫБРАТЬ И ПРИКАЗАТЬ", _bx, _y, _bw, _bh, { call DYN_RTS_openMapForSelection; call fnc_closeMainMenu; }, [0,0,0,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g; [_d, "❌ СНЯТЬ ВЫДЕЛЕНИЕ", _bx, _y, _bw, 0.04, { call DYN_RTS_clearSelection; }, [0,0,0,0.95]] call fnc_guiCreateButton; };
fnc_guiShowTabSmartVehicle = { call fnc_guiClearContent; [5] call fnc_guiHighlightTab; DYN_GUI_CURRENT_TAB = "smartvehicle"; private _d = uiNamespace getVariable ["DYN_GUI_Display", displayNull]; if (isNull _d) exitWith {}; private _bx=0.40; private _bw=0.56; private _bh=0.055; private _g=0.008; private _y=0.155; [_d, "СИСТЕМА ТЕХНИКИ", _bx, _y, _bw, 0.035, [1,0.8,0,1], 0.045] call fnc_guiCreateText; _y = _y + 0.04; [_d, format ["Активных: %1 / %2", count (DYN_SMART_VEHICLES select {alive _x}), DYN_AI_MAX_VEHICLES], _bx, _y, _bw, 0.025, [1,1,1,1], 0.025] call fnc_guiCreateText; _y = _y + 0.04; if (DYN_SMART_VEHICLE_ACTIVE) then { [_d, "⚡ СИСТЕМА АКТИВНА", _bx, _y, _bw, 0.03, [0,1,0,1], 0.035] call fnc_guiCreateText; _y = _y + 0.035; [_d, " ОСТАНОВИТЬ", _bx, _y, _bw, _bh, { call fnc_deactivateSmartVehicleSystem; }, [0.2,0.1,0.1,0.95]] call fnc_guiCreateButton; } else { [_d, "⏸ НЕ АКТИВНА", _bx, _y, _bw, 0.03, [1,0.5,0,1], 0.035] call fnc_guiCreateText; _y = _y + 0.04; [_d, "▶ АКТИВИРОВАТЬ", _bx, _y, _bw, _bh, { call fnc_activateSmartVehicleSystem; }, [0,0.5,0,0.95]] call fnc_guiCreateButton; }; };
fnc_guiShowTabStrikes = { call fnc_guiClearContent; [6] call fnc_guiHighlightTab; DYN_GUI_CURRENT_TAB = "strikes"; private _d = uiNamespace getVariable ["DYN_GUI_Display", displayNull]; if (isNull _d) exitWith {}; private _bx=0.40; private _bw=0.56; private _bh=0.05; private _g=0.008; private _y=0.155; [_d, " УДАРЫ ПО КАРТЕ", _bx, _y, _bw, 0.04, [1,0.8,0,1], 0.045] call fnc_guiCreateText; _y = _y + 0.05; [_d, " УМНАЯ РАКЕТА", _bx, _y, _bw, _bh, { call fnc_callSmartMissileStrike; }, [0.6,0.1,0.1,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g; [_d, " АВИАЦИОННАЯ РАКЕТА", _bx, _y, _bw, _bh, { call fnc_aviationRocketStrikeAtMap; }, [0.5,0.4,0.1,0.95]] call fnc_guiCreateButton; };
fnc_guiShowTabAI = { call fnc_guiClearContent; [7] call fnc_guiHighlightTab; DYN_GUI_CURRENT_TAB = "ai"; private _d = uiNamespace getVariable ["DYN_GUI_Display", displayNull]; if (isNull _d) exitWith {}; private _bx=0.40; private _bw=0.56; private _bh=0.055; private _g=0.008; private _y=0.155; [_d, "ИСКУССТВЕННЫЙ ИНТЕЛЛЕКТ", _bx, _y, _bw, 0.035, [1,0.8,0,1], 0.045] call fnc_guiCreateText; _y = _y + 0.04; [_d, format ["Лимит ИИ: %1, Техника: %2, Авиация: %3", DYN_AI_MAX_UNITS, DYN_AI_MAX_VEHICLES, DYN_AI_MAX_AIR], _bx, _y, _bw, 0.025, [1,1,1,1], 0.025] call fnc_guiCreateText; _y = _y + 0.04; if (DYN_AI_ACTIVE) then { [_d, "⚡ ИИ АКТИВЕН", _bx, _y, _bw, 0.03, [0,1,0,1], 0.035] call fnc_guiCreateText; _y = _y + 0.035; [_d, " ОСТАНОВИТЬ ИИ", _bx, _y, _bw, _bh, { call fnc_deactivateAI; }, [0.2,0.1,0.1,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g; } else { [_d, "⏸ ИИ НЕ АКТИВЕН", _bx, _y, _bw, 0.03, [1,0.5,0,1], 0.035] call fnc_guiCreateText; _y = _y + 0.04; [_d, "▶ АКТИВИРОВАТЬ ИИ", _bx, _y, _bw, _bh, { call fnc_activateAI; }, [0,0.5,0,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g; }; [_d, " РАЗВЕДКА ПЕРЕД АТАКОЙ", _bx, _y, _bw, _bh, { [getPos player] spawn DYN_aiSendScout; }, [0,0.5,0.8,0.95]] call fnc_guiCreateButton; _y = _y + _bh + _g; [_d, "⚔ КООРДИНИРОВАННАЯ АТАКА", _bx, _y, _bw, _bh, { [getPos player] spawn DYN_aiCoordinatedAttack; }, [0.8,0.4,0,0.95]] call fnc_guiCreateButton; };
fnc_guiShowTabStats = {
call fnc_guiClearContent; [8] call fnc_guiHighlightTab; DYN_GUI_CURRENT_TAB = "stats";
private _d = uiNamespace getVariable ["DYN_GUI_Display", displayNull]; if (isNull _d) exitWith {};
private _ri = call DYN_getRankInfo; _ri params ["_rn","_xp","_cxp","_nxp","_pr"];
[_d, " СТАТИСТИКА ИГРОКА", 0.40, 0.15, 0.56, 0.04, [1,0.8,0,1], 0.045] call fnc_guiCreateText;
[_d, format ["Звание: %1", _rn], 0.40, 0.20, 0.56, 0.03, [1,1,1,1], 0.035] call fnc_guiCreateText;
[_d, format ["Опыт: %1 / %2 XP", _xp, _nxp], 0.40, 0.24, 0.56, 0.03, [1,1,1,1], 0.03] call fnc_guiCreateText;
[_d, format ["Прогресс: %1%%", round _pr], 0.40, 0.28, 0.56, 0.03, [1,1,1,1], 0.03] call fnc_guiCreateText;
[_d, format ["Убийств: %1", DYN_KILLS_COUNT], 0.40, 0.32, 0.56, 0.03, [1,1,1,1], 0.03] call fnc_guiCreateText;
private _y = 0.36;
[_d, " БОНУСЫ РАНГА:", 0.40, _y, 0.56, 0.03, [1,0.8,0,1], 0.03] call fnc_guiCreateText; _y = _y + 0.03;
private _maxAI = 70 + (DYN_PLAYER_RANK * 5);
[_d, format ["➕ Лимит ИИ: %1 юнитов", _maxAI], 0.40, _y, 0.56, 0.025, [0.8,1,0.8,1], 0.025] call fnc_guiCreateText; _y = _y + 0.025;
if (DYN_PLAYER_RANK > 0) then { [_d, format [" Регенерация: %1%% / 10с", DYN_PLAYER_RANK * 2], 0.40, _y, 0.56, 0.025, [0.8,1,0.8,1], 0.025] call fnc_guiCreateText; _y = _y + 0.025; };
if (DYN_PLAYER_RANK >= 3) then { [_d, " Бесконечная выносливость", 0.40, _y, 0.56, 0.025, [0.8,1,0.8,1], 0.025] call fnc_guiCreateText; _y = _y + 0.025; };
if (DYN_PLAYER_RANK >= 5) then { [_d, format [" Броня: -%1%% урона", (DYN_PLAYER_RANK - 4) * 10], 0.40, _y, 0.56, 0.025, [0.8,1,0.8,1], 0.025] call fnc_guiCreateText; _y = _y + 0.025; };
_y = _y + 0.01;
[_d, " ЖУРНАЛ СОБЫТИЙ (последние 5)", 0.40, _y, 0.56, 0.04, [1,0.8,0,1], 0.04] call fnc_guiCreateText; _y = _y + 0.035;
private _evts = [5] call DYN_getRecentEvents;
{ _x params ["_time","_type","_msg","_details"]; [_d, format ["[%1] %2: %3", _time, _type, _msg], 0.40, _y, 0.56, 0.025, [0.8,0.8,0.8,1], 0.025] call fnc_guiCreateText; _y = _y + 0.025; } forEach _evts;
_y = _y + 0.01;
[_d, " МИНИ-РАДАР (3D)", 0.40, _y, 0.56, 0.04, [1,0.8,0,1], 0.04] call fnc_guiCreateText; _y = _y + 0.035;
[_d, "ВКЛ/ВЫКЛ РАДАР", 0.40, _y, 0.25, 0.04, { call DYN_toggleMinimap; }, [0,0.5,0.5,0.95]] call fnc_guiCreateButton;
_y = _y + 0.05;
[_d, "⌨ ГОРЯЧИЕ КЛАВИШИ", 0.40, _y, 0.56, 0.04, [1,0.8,0,1], 0.04] call fnc_guiCreateText; _y = _y + 0.035;
[_d, "F1-Умная ракета F2-Авиа ракета F7-Подкреп F8-Танк", 0.40, _y, 0.56, 0.025, [0.8,0.8,0.8,1], 0.025] call fnc_guiCreateText; _y = _y + 0.03;
[_d, "ВКЛ/ВЫКЛ ГОРЯЧИЕ КЛАВИШИ", 0.40, _y, 0.3, 0.04, { call DYN_toggleHotkeys; }, [0,0.5,0.5,0.95]] call fnc_guiCreateButton;
};
// ================ RTS УПРАВЛЕНИЕ ================
DYN_RTS_openMapForSelection = {
DYN_RTS_selectedUnits = []; DYN_RTS_selecting = false; DYN_RTS_awaitingOrder = false;
onMapSingleClick {}; removeAllMissionEventHandlers "MapSingleClick";
openMap [true, true]; waitUntil { !isNull (findDisplay 12) };
uiNamespace setVariable ["DYN_RTS_mapDisplay", findDisplay 12];
uiNamespace setVariable ["DYN_RTS_ctrlMap", (uiNamespace getVariable "DYN_RTS_mapDisplay") displayCtrl 51];
private _ctrlMap = uiNamespace getVariable "DYN_RTS_ctrlMap"; private _mapDisplay = uiNamespace getVariable "DYN_RTS_mapDisplay";
DYN_RTS_mouseDownEH = _ctrlMap ctrlAddEventHandler ["MouseButtonDown", { params ["_c","_b","_x","_y"]; if (_b == 0) then { DYN_RTS_lastMouseDown = [_x, _y, time]; }; }];
DYN_RTS_mouseMovingEH = _ctrlMap ctrlAddEventHandler ["MouseMoving", { params ["_c","_x","_y"]; if (!DYN_RTS_selecting && !isNil "DYN_RTS_lastMouseDown") then { if (sqrt ((_x - DYN_RTS_lastMouseDown#0)^2 + (_y - DYN_RTS_lastMouseDown#1)^2) > DYN_RTS_dragThreshold || (time - DYN_RTS_lastMouseDown#2) > 0.2) then { DYN_RTS_selecting = true; DYN_RTS_awaitingOrder = false; DYN_RTS_selectionStart = [DYN_RTS_lastMouseDown#0, DYN_RTS_lastMouseDown#1]; DYN_RTS_selectionEnd = [_x, _y]; }; }; if (DYN_RTS_selecting) then { DYN_RTS_selectionEnd = [_x, _y]; }; }];
DYN_RTS_mouseUpEH = _ctrlMap ctrlAddEventHandler ["MouseButtonUp", { params ["_c","_b","_x","_y"]; if (_b == 0) then { if (DYN_RTS_selecting) then { DYN_RTS_selecting = false; private _startPos = _c ctrlMapScreenToWorld DYN_RTS_selectionStart; private _endPos = _c ctrlMapScreenToWorld DYN_RTS_selectionEnd; private _x1 = (_startPos#0) min (_endPos#0); private _y1 = (_startPos#1) min (_endPos#1); private _x2 = (_startPos#0) max (_endPos#0); private _y2 = (_startPos#1) max (_endPos#1); private _newSelection = []; { if (side _x == east && !isPlayer _x && alive _x) then { private _p = getPos _x; if (_p#0 >= _x1 && _p#0 <= _x2 && _p#1 >= _y1 && _p#1 <= _y2) then { _newSelection pushBack _x; }; }; } forEach (allUnits select {true}); if (count _newSelection > 0) then { DYN_RTS_selectedUnits = _newSelection; DYN_RTS_awaitingOrder = true; hint format ["Выделено %1 юнитов. Кликните.", count DYN_RTS_selectedUnits]; } else { DYN_RTS_selectedUnits = []; DYN_RTS_awaitingOrder = false; hint "Нет юнитов"; }; } else { if (DYN_RTS_awaitingOrder && count DYN_RTS_selectedUnits > 0) then { private _worldPos = _c ctrlMapScreenToWorld [_x, _y]; private _rad = 150; { if (alive _x) then { if (_x isKindOf "LandVehicle" && !isEngineOn _x) then { _x engineOn true; }; _x setSkill 0.9; _x enableAI "TARGET"; _x enableAI "AUTOTARGET"; _x enableAI "MOVE"; _x enableAI "FSM"; _x setBehaviour "AWARE"; _x setCombatMode "YELLOW"; _x allowFleeing 0; private _g = group _x; if (!isNull _g && _g != group player) then { _g setFormation "WEDGE"; _g setSpeedMode "NORMAL"; }; _x doMove [(_worldPos#0) + (random (_rad*2) - _rad), (_worldPos#1) + (random (_rad*2) - _rad), 0]; }; } forEach DYN_RTS_selectedUnits; hint format ["Приказ отдан %1 юнитам", count DYN_RTS_selectedUnits]; DYN_RTS_selectedUnits = []; DYN_RTS_awaitingOrder = false; }; }; DYN_RTS_lastMouseDown = nil; }; }];
DYN_RTS_keyDownEH = _mapDisplay displayAddEventHandler ["KeyDown", { params ["_d","_k"]; if (_k == 1) then { openMap [false, false]; true } else { false }; }];
DYN_RTS_draw3DEH = addMissionEventHandler ["Draw3D", { { if (alive _x) then { drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", [0,1,0,1], _x modelToWorldVisual (_x selectionPosition "head"), 1, 1, 0, "", 0, 0.05, "TahomaB"]; }; } forEach DYN_RTS_selectedUnits; }];
_mapDisplay displayAddEventHandler ["Unload", { private _cc = uiNamespace getVariable "DYN_RTS_ctrlMap"; private _md = uiNamespace getVariable "DYN_RTS_mapDisplay"; if (DYN_RTS_mouseDownEH != -1 && !isNull _cc) then { _cc ctrlRemoveEventHandler ["MouseButtonDown", DYN_RTS_mouseDownEH]; DYN_RTS_mouseDownEH = -1; }; if (DYN_RTS_mouseMovingEH != -1 && !isNull _cc) then { _cc ctrlRemoveEventHandler ["MouseMoving", DYN_RTS_mouseMovingEH]; DYN_RTS_mouseMovingEH = -1; }; if (DYN_RTS_mouseUpEH != -1 && !isNull _cc) then { _cc ctrlRemoveEventHandler ["MouseButtonUp", DYN_RTS_mouseUpEH]; DYN_RTS_mouseUpEH = -1; }; if (DYN_RTS_keyDownEH != -1 && !isNull _md) then { _md displayRemoveEventHandler ["KeyDown", DYN_RTS_keyDownEH]; DYN_RTS_keyDownEH = -1; }; if (DYN_RTS_draw3DEH != -1) then { removeMissionEventHandler ["Draw3D", DYN_RTS_draw3DEH]; DYN_RTS_draw3DEH = -1; }; uiNamespace setVariable ["DYN_RTS_mapDisplay", displayNull]; uiNamespace setVariable ["DYN_RTS_ctrlMap", controlNull]; DYN_RTS_selecting = false; DYN_RTS_awaitingOrder = false; DYN_RTS_selectedUnits = []; }];
};
DYN_RTS_clearSelection = { DYN_RTS_selectedUnits = []; DYN_RTS_awaitingOrder = false; hint "Выделение сброшено"; };
// ================ АВТООЧИСТКА ================
fnc_startWorldCleanup = { if (!isNull DYN_CLEANUP_THREAD && {!scriptDone DYN_CLEANUP_THREAD}) exitWith {}; DYN_CLEANUP_THREAD = [] spawn { while {true} do { sleep 300; { if (!alive _x && !(_x isKindOf "Man")) then { deleteVehicle _x; }; } forEach vehicles; { if (count units _x == 0) then { deleteGroup _x; }; } forEach allGroups; DYN_SMART_VEHICLES = DYN_SMART_VEHICLES select { alive _x }; DYN_AI_VEHICLES_SPAWNED = DYN_AI_VEHICLES_SPAWNED select { alive _x }; DYN_KAMIKAZE_DRONES = DYN_KAMIKAZE_DRONES select { alive _x }; DYN_SUPPORT_TURRETS = DYN_SUPPORT_TURRETS select { alive _x }; DYN_WOUNDED_UNITS = DYN_WOUNDED_UNITS select { alive _x }; }; }; };
// ============================================================
// ИНИЦИАЛИЗАЦИЯ
// ============================================================
[] spawn {
waitUntil { !isNull player && time > 0 };
sleep 2;
if (side player != east) then { private _group = createGroup east; [player] joinSilent _group; player setVariable ["DYN_SIDE", east, true]; };
east setFriend [west, 0]; west setFriend [east, 0]; east setFriend [east, 1];
DYN_MAIN_PLAYER = player; DYN_PLAYER_SIDE = east; DYN_PLAYER_UNIT_TYPE = typeOf player; DYN_PLAYER_LOADOUT = getUnitLoadout player; DYN_MAIN_PLAYER_POS = getPos player;
for "_i" from 1 to 5 do { private _saved = profileNamespace getVariable [format ["DYN_LOADOUT_%1", _i], []]; if (!(_saved isEqualTo []) && {count _saved > 0}) then { DYN_LOADOUTS set [_i - 1, _saved]; }; };
[player] call fnc_addMainPlayerDeathHandler;
[player] call fnc_attachMenuToUnit;
[player] call fnc_addRankDamageHandler;
if (!isNull DYN_RANK_BUFFS_THREAD && {!scriptDone DYN_RANK_BUFFS_THREAD}) then { terminate DYN_RANK_BUFFS_THREAD; };
DYN_RANK_BUFFS_THREAD = [] spawn fnc_applyRankBuffs;
(findDisplay 46) displayAddEventHandler ["KeyDown", { params ["_display","_key"]; if (_key == 22 && !DYN_GUI_OPEN && !DYN_ARSENAL_OPEN) then { call fnc_openMainMenu; true } else { false }; }];
[] spawn { sleep 3; call DYN_setupHotkeys; };
call fnc_startWorldCleanup;
if (!isNil "DYN_ENTITY_KILLED_EH" && {DYN_ENTITY_KILLED_EH != -1}) then { removeMissionEventHandler ["EntityKilled", DYN_ENTITY_KILLED_EH]; };
DYN_ENTITY_KILLED_EH = addMissionEventHandler ["EntityKilled", { params ["_unit", "_killer", "_instigator"]; private _actualKiller = if (!isNull _instigator) then { _instigator } else { _killer }; if (!isNull _actualKiller && {_actualKiller == player}) then { [_unit, _actualKiller] call DYN_onPlayerKill; }; }];
// Обработчик респавна миссии (восстановление экипировки и меню)
player addEventHandler ["Respawn", {
params ["_unit", "_corpse"];
GZ_isControllingDrone = false; GZ_isControllingPlane = false; GZ_isControllingMegaDrone = false;
DYN_MAIN_PLAYER = _unit;
missionNamespace setVariable ["DRONE_originalPlayer", _unit];
[_unit] call fnc_attachMenuToUnit;
[_unit] call fnc_addMainPlayerDeathHandler;
[_unit] call fnc_addRankDamageHandler;
}];
// Маркер игрока
private _marker = createMarkerLocal ["playerTracker", position player];
_marker setMarkerTypeLocal "mil_arrow2"; _marker setMarkerColorLocal "ColorEAST"; _marker setMarkerTextLocal format["%1", name player]; _marker setMarkerSizeLocal [0.7, 0.7];
[] spawn { while {alive player} do { private _pos = getPos player; if (count _pos >= 3) then { "playerTracker" setMarkerPosLocal _pos; "playerTracker" setMarkerDirLocal (getDir player); }; uiSleep 0.5; }; deleteMarkerLocal "playerTracker"; };
systemChat "=========================================";
systemChat "DYNAMIC CONFLICT v19.19 ЗАГРУЖЕНА!";
systemChat "Ранг: " + ((DYN_RANKS select DYN_PLAYER_RANK) select 0) + " | Убийств: " + str DYN_KILLS_COUNT + " | XP: " + str DYN_PLAYER_XP;
systemChat "F-35 найдено: " + str (count DYN_F35_CLASSES);
systemChat "НАЖМИТЕ U ДЛЯ МЕНЮ";
systemChat "=========================================";
};
Например, в редакторе поставил стол, на него положил оружие, и к нему мне нужно прикрепить прицел, чтобы непосредственно в игре на данном столе это оружие лежало уже с установленным на него прицелом.
вообщем вставляешь этот код в окно консоли в игре
Сообщение отредактировал Cozzac: 28 September 2026 - 17:56
- 0
Ответить цитируемым сообщениям Очистить











