busfahrer dont allow move when in route selection

This commit is contained in:
hydrant
2021-04-24 01:22:05 +02:00
parent 3687f88a5d
commit 01b3083747
3 changed files with 12 additions and 2 deletions

View File

@@ -30,6 +30,7 @@ export default function busRouteList(globalData: IGlobalData) {
skill = jobskill; skill = jobskill;
if (!globalData.InMenu) { if (!globalData.InMenu) {
globalData.InMenu = true; globalData.InMenu = true;
globalData.BlockMovement = true;
skillSelect = ["Anfänger", "Fortgeschrittener", "Profi"]; skillSelect = ["Anfänger", "Fortgeschrittener", "Profi"];
@@ -70,7 +71,6 @@ export default function busRouteList(globalData: IGlobalData) {
} else if (item.Text === "Abbrechen") { } else if (item.Text === "Abbrechen") {
mp.events.callRemote("CLIENT:Job_StopJob"); mp.events.callRemote("CLIENT:Job_StopJob");
routeMenu.Close(); routeMenu.Close();
globalData.InMenu = false;
} }
}); });
@@ -80,6 +80,7 @@ export default function busRouteList(globalData: IGlobalData) {
} }
routeSelected = false; routeSelected = false;
globalData.BlockMovement = false;
globalData.InMenu = false; globalData.InMenu = false;
}); });
} }

View File

@@ -5,6 +5,7 @@
InChat: boolean, InChat: boolean,
LoggedIn: boolean, LoggedIn: boolean,
IsAfk: boolean, IsAfk: boolean,
BlockMovement: boolean;
} }
declare type AccountData = { declare type AccountData = {

View File

@@ -15,6 +15,7 @@ let globalData: IGlobalData = {
InChat: false, InChat: false,
LoggedIn: false, LoggedIn: false,
IsAfk: false, IsAfk: false,
BlockMovement: false,
get InMenu(): boolean { get InMenu(): boolean {
return inMenu; return inMenu;
@@ -26,6 +27,13 @@ let globalData: IGlobalData = {
} }
}; };
mp.events.add(RageEnums.EventKey.RENDER, (nametags) => {
if (globalData.BlockMovement) {
mp.game.controls.disableAllControlActions(0);
mp.game.controls.disableAllControlActions(27);
}
});
const game: IGame = new RageGame(); const game: IGame = new RageGame();
export default game; export default game;
export { export {