Casio91Fin 31 Posted May 14, 2019 Hey How to get (AI) machinegunner to shoot 30 shots after noticing the player or possibly shoot Suppressive Fire if the player is over 300 m It would be good if it is a function. Define.sqf GunsType = ["rhs_weap_pkm", "rhs_weap_mg42" ]; Share this post Link to post Share on other sites
beno_83au 1362 Posted May 16, 2019 So, simple version, add the below to a script (let's go with fire.sqf). Haven't tested it, but I've taken it out of a function I wrote that worked, and just changed it a little bit. fire.sqf params ["_unit","_rounds"]; _logic = createGroup west createUnit ["Logic", [0,0,0], [], 0, "NONE"]; _weapon = primaryWeapon _unit; _endBurst = ((_unit ammo _weapon) - _rounds); while {((_unit ammo _weapon) > _endBurst) && ((_unit ammo _weapon) != 0) && (alive _unit)} do { _firer action ["UseWeapon",vehicle _unit,_unit,0]; }; Run it with: nul = [_unit,_rounds] execVM "fire.sqf"; - _unit - the unit to be firing. - _rounds - the number of rounds to fire. Alternatively, you could have a look at using the function I took it from: It'll allow you to do things like this (video says WIP, but it's a complete system now): Bit more complex than the above code, but you might find use for it. Share this post Link to post Share on other sites