#Conditional Hooks

$Application: FS2_Open
$On Mission Start: 
[
runZoomScript = true
step = 0
normalFOV = 0.60
step1 = normalFOV * 0.50
step2 = normalFOV * 0.20
SensFactor =0.01
]

$Application: FS2_Open
$On Mission End: 
[
runZoomScript = false
]

$State: GS_STATE_GAME_PLAY
$KeyPress: l
$On Key Pressed: [
if runZoomScript then
 if #gr.Cameras > 0 then
  cam = gr.getCurrentCamera(true)
  if cam:isValid() then  
   if step == 0 then
    ad.playSound(ad.getSoundentry("bzoomin"))
	cam:setFOV(step1,.30,.15,.08)
    step = 1
   elseif step == 1 then
	ad.playSound(ad.getSoundentry("bzoomin"))
	cam:setFOV(step2,.30,.15,.08)
	step = 2
   elseif step == 2 then
	ad.playSound(ad.getSoundentry("bzoomout"))
    cam:setFOV(normalFOV,.60,.15,.08)
	step = 0
   end
  end
 end
end
] 


$On Frame: [
if runZoomScript then
 if step > 0 then
  local ci = ba.getControlInfo()
  ci.Pitch = ci.Pitch * SensFactor / step
  ci.Heading = ci.Heading * SensFactor / step
 end
end
]

#End