Hi,
I'm trying to create a script where a flare is created at a certain height (on the way down), after an artillery shell having been fired...
this AddEventHandler ["fired",{_this exec "scripts\flare.sqs"}] calls...
"flare.sqs"
_firer = _this select 0
_ammo = _this select 4
_shell = nearestObject [_firer, _ammo]
~5
@ (getpos _shell select 2 <=100)
player sidechat "Flares"
flare1 = "F_40mm_White" createvehicle getpos _shell
deletevehicle _shell
flare1 setVelocity [0, 0, 1]
_firer removeEventHandler ["fired",0]
exit
It's for an artillery script I'm working on, it just doesn't seem to work. I get the "Flares" sidechat five seconds after firing, so I guess the problem lies with detecting the height of the shell. The shell itself is also not being deleted.
I originally wrote this for OFP and it worked fine.
Any help would be greatly appreciated!
Thanks.