diff --git a/ReallifeGamemode.Client/util/drivingschool.ts b/ReallifeGamemode.Client/util/drivingschool.ts index 2a7ace68..f94e316b 100644 --- a/ReallifeGamemode.Client/util/drivingschool.ts +++ b/ReallifeGamemode.Client/util/drivingschool.ts @@ -33,15 +33,15 @@ export default function drivingSchoolHandle(globalData: GlobalData) { keyBound = true; }); - mp.events.add('removeDrivingSchoolMenu', (unbind) => { + mp.events.add('removeDrivingSchoolMenu', () => { mp.game.ui.clearHelp(true); - mp.gui.chat.show(true); + if (mainMenu != null) { + mainMenu.Close(); + } - if (keyBound && unbind) { - if (mainMenu) mainMenu.Close(); - - mp.keys.unbind(0x45, false, keyPressHandler); + if (keyBound) { keyBound = false; + mp.keys.unbind(0x45, false, keyPressHandler); } }); diff --git a/ReallifeGamemode.Client/util/planeschool.ts b/ReallifeGamemode.Client/util/planeschool.ts index cbbfb43d..706f57e8 100644 --- a/ReallifeGamemode.Client/util/planeschool.ts +++ b/ReallifeGamemode.Client/util/planeschool.ts @@ -33,15 +33,16 @@ export default function planeSchoolHandle(globalData: GlobalData) { keyBound = true; }); - mp.events.add('removeplaneSchoolMenu', (unbind) => { + mp.events.add('removeplaneSchoolMenu', () => { + mp.game.ui.clearHelp(true); - mp.gui.chat.show(true); + if (mainMenu != null) { + mainMenu.Close(); + } - if (keyBound && unbind) { - if (mainMenu) mainMenu.Close(); - - mp.keys.unbind(0x45, false, keyPressHandler); + if (keyBound) { keyBound = false; + mp.keys.unbind(0x45, false, keyPressHandler); } });