; minigun.sqs
; Syntax:
; [position from map click,time in seconds,radius in metres,rate of fire in rounds per min] Exec "minigun.sqs"
; notes
; bullets 'fired' at 30 degree angle to maximise chance of hitting something,
; point of aim is offset from target object to compensate.
; _radius = random _strikeradius - linear distribution
; _radius = _strikeradius * (random 1)^2 - concentrates fire on point of aim
; _radius = _strikeradius * sqrt (random 1) - even spread across area
;_markerobj = _this Select 0
_firetime = _this Select 1
_strikeradius = _this Select 2
_rateoffire = _this Select 3
_strikex = (_this select 0) Select 0
_strikey = ((_this select 0) Select 1) - 6
_delay = 60 / _rateoffire
_stoptime = time + _firetime
#fire
; POI
_angle = random 360
; _radius = random _strikeradius
; swap with either to taste:
; _radius = _strikeradius * (random 1)^2
_radius = _strikeradius * sqrt (random 1)
_strike = "Bullet12_7W" CamCreate [_strikex + (_radius * Sin _angle),_strikey + (_radius * Cos _angle),3]
; _strike = "Bullet7_6W" CamCreate [_strikex + (_radius * Sin _angle),_strikey + (_radius * Cos _angle),3]
_strike SetVelocity [0,500,-300]
~_delay
?(time > _stoptime): exit
Goto "fire"
exit
The map click command would then be:
onMapSingleClick "[_pos,myTime,myRadius,myROF] exec 'minigun.sqs'"
where myTime, myRadius, and myROF are the values you wish to insert. _pos is a variable passed by the onMapSingleClick command.
If you wish to disable the map click after it's been executed, use this command instead:
onMapSingleClick "[_pos, myTime, myRadius, myROF] exec 'minigun.sqs'; onMapSingleClick ' ';"
[EDIT] That should work - if it doesn't I'll give it a run when I can play in ArmA.