vbegin7 Posted December 30, 2018 Report Posted December 30, 2018 @Pete Dowson FSUIPC is awesome pete thanks for creating such fine development. on a richer not im trying to create a variable in an acars system im building for the user to select a checkbox to pause at 10,000 ft this is what i have and it doesnt like it too much. Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click If (tenth.Checked) Then tenth.Checked = False Else tenth.Checked = True playerAltitude = 10000 // or getaltitude() pause1.Checked = True End If End Sub Thanks for any help given Best Regards, Vince
Paul Henty Posted December 30, 2018 Report Posted December 30, 2018 Hi Vince, Generally, to achieve what you want, you need to be checking the altitude regularly in a timer. If the altitude is 10000 AND the checkbox is checked then you need to pause. However, the altitude may never be exactly 10000, it might go from 9999 to 10001 so you need to test a range. Something like this (Not real code): TimerEvent: FSUIPCConnection.Process() alt = getCurrentAltitudeInFeet() if alt < 10100 AND alt > 9900 AND pauseAt10000 is checked pauseSim() pauseAt10000.checked = false end if Paul
vbegin7 Posted December 30, 2018 Author Report Posted December 30, 2018 41 minutes ago, Paul Henty said: Hi Vince, Generally, to achieve what you want, you need to be checking the altitude regularly in a timer. If the altitude is 10000 AND the checkbox is checked then you need to pause. However, the altitude may never be exactly 10000, it might go from 9999 to 10001 so you need to test a range. Something like this (Not real code): TimerEvent: FSUIPCConnection.Process() alt = getCurrentAltitudeInFeet() if alt < 10100 AND alt > 9900 AND pauseAt10000 is checked pauseSim() pauseAt10000.checked = false end if Paul Thanks paul, for the reply i will give it a whirl
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now