Well from a realism standpoint it really doesn't matter if the engine is on.
If you have a leak, fuel will run through it, even if the engine is off.
I would also change the script to this:
; This script simulates a fuel leak
; it runs till there is no fuel left.
; starting this script will start the leak
_chopper = _this select 0
_drain = _this select 1
_chopperheight = _this select 1
~2
#drain
~1.5
_chopper setfuel ((fuel _chopper) - _drain)
;YOU_Fuel_drain_end is a global variable used to end this script
?(fuel _chopper > 0) : goto "drain"
What's the difference?
It doesn't need the detour with the _amout, and makes all in one step...
Also you don't need the exit If-Statement...
Though I don't know what takes more time, the 3 lines with private
variables, or 2 times calling the fuel function, probably the first....
ahhh I guess I'm just confusing people...
Here is a little way to randomly start a leak if shot at:
;---------- INIT
;get Helo
_chopper = _this select 0
;get proportionally faktor
_deri = 1
;get Chopper dammage
_dam = Getdammage _chopper
;difference between Chopper dammage and last cycle
_dif = 0
;----------- INIT END
#loop
;get differenc
_dif = (GetDammage _Chopper) - _dam
?(_dif == 0):goto "end_loop"
;start drain script with amount proportional to dammage
?(random _deri < _dif)):[_chopper, 0.01] exec "your_drain_script.sqs"
#end_loop
~2
goto "loop"
It should make the possibility that you take a leak proportional to the
dammage you absorbed during the last cycle (if you are hit by AAA you'd
be more likely to get a leak, than being hit by an AK, though it's still possible to get a leak by an AK-Hit)
It's untested though...
-Fishion