Fi gauge command subscribe

From Sim Innovations Wiki
Jump to navigation Jump to search

Description

fi_gauge_command_subscribe(fi_gauge_id, command_name, callback_function)

fi_gauge_command_subscribe is used to subscribe to a Flight Illusion gauge command.

See Flight Illusion Gauges for available commands.

Return value

This function won't return any value.

Arguments

# Argument Type Description
1 fi_gauge_id String Reference to the flight illusion gauge.
2 comand_name String Name of the command. See Flight Illusion Gauges for available commands.
3 callback_function Function The function to call when the command is fired.

Example

-- Get a reference to the gauge
fi_gauge_id = fi_gauge_add(122, "BENDIX_KING_TRANSPONDER")

-- Subscribe to the IDF_PRESSED command
fi_gauge_command_subscribe(fi_gauge_id, "IDF_PRESSED", function()
    print("IDF pressed")
end)