if (mdh_clothesS > 0) then {mdh_headgears = mdh_headgears + mdh_headgearsE};
mdh_headgear = {player addheadgear (mdh_headgears select (floor random (count mdh_headgears)))};
mdh_handgrenade = { for "_x" from 1 to (mdh_grenades) do { player addMagazine "handgrenade" }; };
switch (mdh_weapons) do { case 9: {mdh_allweapons = mdh_pistols+mdh_pistols+mdh_pistols+mdh_pistols+mdh_pistols+mdh_pistols+mdh_pistols+chris_mp7}; default {mdh_allweapons = mdh_pistols+mdh_pistols+mdh_pistols+mdh_pistols+mdh_pistols+mdh_pistols+mdh_pistols+chris_mp7}; };
mdh_weaponsel = { private["_random"]; _random = floor random (count mdh_allweapons); (mdh_allweapons select _random select 0) call mdh_mag; player addWeapon (mdh_allweapons select _random select 1); if (weapons player select 0 in mdh_pistolsE) then { player switchmove "amovpercmstpsraswpstdnon"; player selectWeapon (weapons player select 0); } else { player switchmove "amovpercmstpsraswrfldnon"; player selectWeapon (weapons player select 0); }; };
mdh_aliveplayer = { removeallweapons player; if (mdh_clothesS > 0) then {call call mdh_clothe}; call mdh_vest; call mdh_headgear; call mdh_weaponsel;
if (mdh_grenades > 0) then { call mdh_handgrenade }; };
mdh_checkalive = { while {isNil"endofgame"} do { waituntil{alive player}; call mdh_aliveplayer; player removeAllEventHandlers "killed"; player addEventHandler ["killed", { 0=[(_this select 0)]spawn { sleep 10; hideBody (_this select 0); sleep 5; deleteVehicle (_this select 0) } }]; waituntil{!alive player}; }; };
mdh_randompos = { [ (getMarkerPos "respawn_civilian" select 0)+ ((round random (getMarkerSize "respawn_civilian" select 0))- (round random (getMarkerSize "respawn_civilian" select 0))), (getMarkerPos "respawn_civilian" select 1)+ ((round random (getMarkerSize "respawn_civilian" select 1))- (round random (getMarkerSize "respawn_civilian" select 1))) ] };
Не удивительно что не работает, он только для игрока, везде player addWeapon и т.д. Тебе надо аргументом в скрипт передавать юнита которому ты хочешь дать шмотки и в скрипте заменить player на _this (не добавляй скрипт в init строки юнитов только, если миссия не сингловая)
Код_bot call compile preprocessFileLineNumbers "moy_skript.sqf"; Ну а если все-таки сингловая и можно спокойно использовать инит строки то
Код this call compile preprocessFileLineNumbers "moy_skript.sqf";