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

View File

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

View File

@@ -15,6 +15,7 @@ let globalData: IGlobalData = {
InChat: false,
LoggedIn: false,
IsAfk: false,
BlockMovement: false,
get InMenu(): boolean {
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();
export default game;
export {