MatthewK Posted December 6, 2014 Report Share Posted December 6, 2014 Has anyone managed to get an m2 machine gunner in their missions? Can you share your code please. thanks Link to comment Share on other sites More sharing options...
TheVampire Posted December 6, 2014 Report Share Posted December 6, 2014 You would have to spawn the M2 in as a vehicle in the mission code, make it unenterable for players (similar to the C130 in EM1) and then get a unit nearby and shove them into it using moveInDriver. MatthewK 1 Link to comment Share on other sites More sharing options...
Saltzman Posted December 14, 2014 Report Share Posted December 14, 2014 Vampire please put M2's in by default. There is alot of requests for it. Link to comment Share on other sites More sharing options...
IvertizPL Posted March 24, 2015 Report Share Posted March 24, 2015 My scripting is bad, so I don't create new function just add this code to the mission file: _staticGun = createVehicle ["M2StaticMG",[(_coords select 0) - 8.8681, (_coords select 1) + 15.3554,0],[], 0, "NONE"]; _staticGun setDir round(random 360); [_staticGun] call DZMSProtectObj; _staticGun setHit ["motor", 1]; _staticGun setVariable ["R3F_LOG_disabled",true,true]; _staticGun setVariable ["BTC_Cannot_Lift",true,true]; _staticGun removeAllEventHandlers "Killed"; _staticGun removeAllEventHandlers "HandleDamage"; _staticGun setVehicleLock "LOCKED"; _staticGun removeAllEventHandlers "GetIn"; _staticGun addEventHandler ["GetIn",{ if (isPlayer (_this select 2)) then { (_this select 2) action ["getOut",(_this select 0)]; (_this select 0) setVehicleLock "LOCKED"; (_this select 0) removeAllEventHandlers "GetIn"; }; }]; _aiGrp = createGroup east; _pilot = _aiGrp createUnit ["BanditW1_DZ",getPos _staticGun,[],0,"FORM"]; [_pilot] joinSilent _aiGrp; _pilot moveInGunner _staticGun; _pilot assignAsGunner _staticGun; _pilot enableAI "TARGET"; _pilot enableAI "AUTOTARGET"; _pilot enableAI "MOVE"; _pilot enableAI "ANIM"; _pilot enableAI "FSM"; _pilot setCombatMode "YELLOW"; _pilot setBehaviour "COMBAT"; _pilot addWeapon 'NVGoggles'; _pilot addWeapon 'ItemCompass'; _pilot addWeapon 'ItemRadio'; _pilot addWeapon 'ItemMap'; _pilot addWeapon 'ItemGPS'; Just starting writing scripts to the Arma 2, so this code can be bad but it works ;) Link to comment Share on other sites More sharing options...
Hooty Posted November 25, 2016 Report Share Posted November 25, 2016 Have you tried adding M2s to the Partol vech section in the config.. Assuming you have the vehicle patrols installed already. I'll test it out and see how it goes. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now