Jump to content
Sign in to follow this  
Damlimey

Can anyone tell me what is wrong with this code? Again.

Recommended Posts

Hi all,

Slowly getting to grips with using LINDA for custom actions with switches etc but still having a problem getting my head into reading Lvars and getting returned values to trigger other things like a sound etc.

I think I know enough to know that the code below is wrong but it would help me enormously if someone could correct it. This would lead me onto a greater use of LINDA, even if it just helps the penny to drop.

I have a module file that works well for switches but somehow, I have it in my head that this sort of code should be in the 'user' file and so that is where I have put this...

-- Fuel Alarm --
function Fuel_Alarm()
ftq=readLvar("FUEL_TOTAL_QUANTITY",gallons)
if ftq<=(30) then
alarmf=sound.play("BingoFuel")
sound.adjust(alarmf,-100)
else
end
end

Thanks in advance,

D

Share this post


Link to post
Share on other sites

if ftq<=(30) then
 

this?

if (ftq<=30) then
 


CASE: Custom ALU 5.3L CPU: AMD R5 7600X RAM: 32GB DDR5 5600 GPU: nVidia RTX 4060 · SSDs: Samsung 990 PRO 2TB M.2 PCIe · PNY XLR8 CS3040 2TB M.2 PCIe · VIDEO: LG-32GK650F QHD 32" 144Hz FREE/G-SYNC · MISC: Thrustmaster TCA Airbus Joystick + Throttle Quadrant · MSFS DX11 · Windows 11

Share this post


Link to post
Share on other sites

Thanks Nuno Pinto for the suggestion. Unfortunately, it hasn't fixed it. I'm thinking that maybe this function should be under one of my switch functions, like the battery on/off function in the actions file.

I'll try that.

D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...