diff --git a/ReallifeGamemode.Client/Business/main.ts b/ReallifeGamemode.Client/Business/main.ts index 7737a963..dfb2b679 100644 --- a/ReallifeGamemode.Client/Business/main.ts +++ b/ReallifeGamemode.Client/Business/main.ts @@ -54,7 +54,7 @@ export default function business(globalData: IGlobalData) { function keyPressHandler() { mp.events.call('SERVER:Business_RemoveHelp', false); - if (globalData.InChat || globalData.InInput || globalData.InMenu) return; + if (globalData.InChat || globalData.InMenu || globalData.InMenu) return; globalData.InMenu = true; @@ -93,7 +93,7 @@ export default function business(globalData: IGlobalData) { bankMenu.ItemSelect.on((item, index) => { if (item === depositItem) { - globalData.InInput = true; + globalData.InMenu = true; var depositInput = new InputHelper("Wie viel Geld möchtest du auf deine Businesskasse einzahlen?", globalData); depositInput.show(); depositInput.getValue((data) => { @@ -103,13 +103,13 @@ export default function business(globalData: IGlobalData) { return; } - globalData.InInput = false; + globalData.InMenu = false; mp.events.callRemote('Business_DepositMoney', amount); mainMenu.Close(); }); } else if (item === withdrawItem) { - globalData.InInput = true; + globalData.InMenu = true; var withdrawInput = new InputHelper("Wie viel Geld möchtest du von deiner Businesskasse abheben?", globalData); withdrawInput.show(); withdrawInput.getValue((data) => { @@ -118,7 +118,7 @@ export default function business(globalData: IGlobalData) { mp.game.graphics.notify('~r~Du musst eine Nummer eingeben!'); return; } - globalData.InInput = false; + globalData.InMenu = false; mp.events.callRemote('Business_WithdrawMoney', amount); mainMenu.Close(); diff --git a/ReallifeGamemode.Client/CharCreator/main.ts b/ReallifeGamemode.Client/CharCreator/main.ts index 609cab5f..1c79dc30 100644 --- a/ReallifeGamemode.Client/CharCreator/main.ts +++ b/ReallifeGamemode.Client/CharCreator/main.ts @@ -317,13 +317,13 @@ export default function charCreator(globalData: IGlobalData) { mp.game.cam.renderScriptCams(false, false, 0, true, false); mp.events.callRemote("creatorSave", currentGender, JSON.stringify(parentData), JSON.stringify(featureData), JSON.stringify(appearanceData), JSON.stringify(hairAndColors)); globalData.InMenu = false; - globalData.InInput = false; + globalData.InMenu = false; break; case 7: mp.events.callRemote("creator_Leave"); globalData.InMenu = false; - globalData.InInput = false; + globalData.InMenu = false; break; } }); @@ -331,7 +331,7 @@ export default function charCreator(globalData: IGlobalData) { creatorMainMenu.MenuClose.on(() => { mp.events.callRemote("creator_Leave"); globalData.InMenu = false; - globalData.InInput = false; + globalData.InMenu = false; }); creatorMainMenu.Visible = false; @@ -560,7 +560,7 @@ export default function charCreator(globalData: IGlobalData) { creatorCamera.setActive(true); globalData.InMenu = true; - globalData.InInput = true; + globalData.InMenu = true; creatorMainMenu.Visible = true; mp.gui.chat.show(false); diff --git a/ReallifeGamemode.Client/Gui/Inventory/inventory.ts b/ReallifeGamemode.Client/Gui/Inventory/inventory.ts index 45d97981..0b4b95d2 100644 --- a/ReallifeGamemode.Client/Gui/Inventory/inventory.ts +++ b/ReallifeGamemode.Client/Gui/Inventory/inventory.ts @@ -852,7 +852,7 @@ export default function inventory(globalData: IGlobalData) { //Wenn Maus über Dollar Zeichen if (isTrading && isMouseOverTradeDollar(x, y)) { - globalData.InInput = true; + globalData.InMenu = true; var tradeMoney = new InputHelper("Wie viel $ möchtest du für deine Items haben?", globalData); tradeMoney.show(); tradeMoney.getValue((data) => { @@ -861,7 +861,7 @@ export default function inventory(globalData: IGlobalData) { mp.game.graphics.notify('~r~Du musst eine Zahl größer als 0 eingeben!'); return; } - globalData.InInput = false; + globalData.InMenu = false; tradePrize = amount; }); } @@ -878,7 +878,7 @@ export default function inventory(globalData: IGlobalData) { switch (radialSelect) { case "up": var dropInput = new InputHelper("Wie viel Items möchtest du wegwerfen?", globalData); - globalData.InInput = true; + globalData.InMenu = true; dropInput.show(); dropInput.getValue((data) => { var amount = parseInt(data); @@ -891,7 +891,7 @@ export default function inventory(globalData: IGlobalData) { } mp.events.callRemote('itemInteract', "drop", items[clickedItem][5], amount); }); - globalData.InInput = false; + globalData.InMenu = false; itemRadial = false; break; case "down": diff --git a/ReallifeGamemode.Client/Gui/ahelp.ts b/ReallifeGamemode.Client/Gui/ahelp.ts index 22025441..831723d6 100644 --- a/ReallifeGamemode.Client/Gui/ahelp.ts +++ b/ReallifeGamemode.Client/Gui/ahelp.ts @@ -13,12 +13,12 @@ export default function ahelp(globalData: IGlobalData): void { if (ahelpBrowser !== null) { ahelpBrowser.destroy(); ahelpBrowser = null; - globalData.InInput = false; + globalData.InMenu = false; mp.gui.cursor.show(false, false); mp.gui.chat.activate(true); } - else if (!globalData.InInput) { - globalData.InInput = true; + else if (!globalData.InMenu) { + globalData.InMenu = true; ahelpBrowser = mp.browsers.new('package://assets/html/helpcommand/ahelp.html'); mp.gui.chat.activate(false); mp.gui.cursor.show(true, true); @@ -30,10 +30,10 @@ export default function ahelp(globalData: IGlobalData): void { if (ahelpBrowser == null) { return; } - else if (globalData.InInput) { + else if (globalData.InMenu) { ahelpBrowser.destroy(); ahelpBrowser = null; - globalData.InInput = false; + globalData.InMenu = false; mp.gui.cursor.show(false, false); mp.gui.chat.activate(true); } @@ -44,12 +44,12 @@ export default function ahelp(globalData: IGlobalData): void { if (ahelpBrowser !== null) { ahelpBrowser.destroy(); ahelpBrowser = null; - globalData.InInput = false; + globalData.InMenu = false; mp.gui.cursor.show(false, false); mp.gui.chat.activate(true); } - else if (!globalData.InInput) { - globalData.InInput = true; + else if (!globalData.InMenu) { + globalData.InMenu = true; ahelpBrowser = mp.browsers.new('package://assets/html/helpcommand/shelp.html'); mp.gui.chat.activate(false); mp.gui.cursor.show(true, true); diff --git a/ReallifeGamemode.Client/Gui/cityhall.ts b/ReallifeGamemode.Client/Gui/cityhall.ts index 8878c8ba..b12fc0fe 100644 --- a/ReallifeGamemode.Client/Gui/cityhall.ts +++ b/ReallifeGamemode.Client/Gui/cityhall.ts @@ -89,13 +89,13 @@ export default function (globalData: IGlobalData) { menu.ItemSelect.on((item: NativeUI.UIMenuItem, index) => { if (item === groupCreateItem) { // Gruppe - globalData.InInput = true; + globalData.InMenu = true; var input = new InputHelper("Wie soll die Gruppe heißen?", globalData); input.show(); input.getValue((name: string) => { mp.events.callRemote("CLIENT:CityHall_CreateGroup", name); menu.Close(true); - globalData.InInput = false; + globalData.InMenu = false; }); } else if (item === cancelItem) { menu.Close(); diff --git a/ReallifeGamemode.Client/Gui/drivingschool.ts b/ReallifeGamemode.Client/Gui/drivingschool.ts index 9b36e117..47652ea1 100644 --- a/ReallifeGamemode.Client/Gui/drivingschool.ts +++ b/ReallifeGamemode.Client/Gui/drivingschool.ts @@ -12,12 +12,12 @@ export default function Introduction(globalData: IGlobalData): void { if (DrivingSchoolBrowser !== null) { DrivingSchoolBrowser.destroy(); DrivingSchoolBrowser = null; - globalData.InInput = false; + globalData.InMenu = false; mp.gui.cursor.show(false, false); mp.gui.chat.activate(true); } - else if (!globalData.InInput) { - globalData.InInput = true; + else if (!globalData.InMenu) { + globalData.InMenu = true; DrivingSchoolBrowser = mp.browsers.new('package://assets/html/School/DrivingSchool.html'); mp.gui.chat.activate(false); mp.gui.cursor.show(true, true); @@ -28,10 +28,10 @@ export default function Introduction(globalData: IGlobalData): void { if (DrivingSchoolBrowser == null) { return; } - else if (globalData.InInput) { + else if (globalData.InMenu) { DrivingSchoolBrowser.destroy(); DrivingSchoolBrowser = null; - globalData.InInput = false; + globalData.InMenu = false; mp.gui.cursor.show(false, false); mp.gui.chat.activate(true); } diff --git a/ReallifeGamemode.Client/Gui/introduction.ts b/ReallifeGamemode.Client/Gui/introduction.ts index bea7d8fc..e7fac9ba 100644 --- a/ReallifeGamemode.Client/Gui/introduction.ts +++ b/ReallifeGamemode.Client/Gui/introduction.ts @@ -13,12 +13,12 @@ export default function Introduction(globalData: IGlobalData): void { if (IntroductionBrowser !== null) { IntroductionBrowser.destroy(); IntroductionBrowser = null; - globalData.InInput = false; + globalData.InMenu = false; mp.gui.cursor.show(false, false); mp.gui.chat.activate(true); } - else if (!globalData.InInput) { - globalData.InInput = true; + else if (!globalData.InMenu) { + globalData.InMenu = true; IntroductionBrowser = mp.browsers.new('package://assets/html/Introduction/Introduction.html'); mp.gui.chat.activate(false); mp.gui.cursor.show(true, true); @@ -31,10 +31,10 @@ export default function Introduction(globalData: IGlobalData): void { if (IntroductionBrowser == null) { return; } - else if (globalData.InInput) { + else if (globalData.InMenu) { IntroductionBrowser.destroy(); IntroductionBrowser = null; - globalData.InInput = false; + globalData.InMenu = false; mp.gui.cursor.show(false, false); mp.gui.chat.activate(true); diff --git a/ReallifeGamemode.Client/Gui/playerlist.ts b/ReallifeGamemode.Client/Gui/playerlist.ts index aabc8714..3a136335 100644 --- a/ReallifeGamemode.Client/Gui/playerlist.ts +++ b/ReallifeGamemode.Client/Gui/playerlist.ts @@ -14,13 +14,11 @@ export default function playerList(globalData: IGlobalData): void { if (playerlistBrowser !== null) { playerlistBrowser.destroy(); playerlistBrowser = null; - globalData.InInput = false; globalData.InMenu = false; mp.gui.cursor.show(false, false); mp.gui.chat.activate(true); } else if (!globalData.InMenu) { - globalData.InInput = true; globalData.InMenu = true; playerlistBrowser = mp.browsers.new('package://assets/html/Playerlist/Tabliste.html'); mp.gui.chat.activate(false); diff --git a/ReallifeGamemode.Client/Gui/taximeter.ts b/ReallifeGamemode.Client/Gui/taximeter.ts index af3354b8..fe934bef 100644 --- a/ReallifeGamemode.Client/Gui/taximeter.ts +++ b/ReallifeGamemode.Client/Gui/taximeter.ts @@ -41,7 +41,7 @@ export default function taximeterInput(globalData: IGlobalData) { browser.destroy(); browser = null; } - globalData.InInput = false; + globalData.InMenu = false; }); function myTimer() { diff --git a/ReallifeGamemode.Client/Gui/userhelp.ts b/ReallifeGamemode.Client/Gui/userhelp.ts index 6985fc7e..99850273 100644 --- a/ReallifeGamemode.Client/Gui/userhelp.ts +++ b/ReallifeGamemode.Client/Gui/userhelp.ts @@ -13,12 +13,12 @@ export default function userhelp(globalData: IGlobalData): void { if (userhelpBrowser !== null) { userhelpBrowser.destroy(); userhelpBrowser = null; - globalData.InInput = false; + globalData.InMenu = false; mp.gui.cursor.show(false, false); mp.gui.chat.activate(true); } - else if (!globalData.InInput) { - globalData.InInput = true; + else if (!globalData.InMenu) { + globalData.InMenu = true; userhelpBrowser = mp.browsers.new('package://assets/html/helpcommand/userhelp.html'); mp.gui.chat.activate(false); mp.gui.cursor.show(true, true); @@ -31,10 +31,10 @@ export default function userhelp(globalData: IGlobalData): void { if (userhelpBrowser == null) { return; } - else if (globalData.InInput) { + else if (globalData.InMenu) { userhelpBrowser.destroy(); userhelpBrowser = null; - globalData.InInput = false; + globalData.InMenu = false; mp.gui.cursor.show(false, false); mp.gui.chat.activate(true); diff --git a/ReallifeGamemode.Client/Gui/vehiclemenu/main.ts b/ReallifeGamemode.Client/Gui/vehiclemenu/main.ts index 9aed55f3..d5988b50 100644 --- a/ReallifeGamemode.Client/Gui/vehiclemenu/main.ts +++ b/ReallifeGamemode.Client/Gui/vehiclemenu/main.ts @@ -14,6 +14,7 @@ export default function vehicleMenu(globalData: IGlobalData) { if (menuBrowser !== null) { menuBrowser.destroy(); menuBrowser = null; + globalData.InMenu = false; mp.gui.chat.show(true); mp.gui.cursor.show(false, false); mp.game.graphics.stopScreenEffect("FocusIn"); @@ -25,6 +26,7 @@ export default function vehicleMenu(globalData: IGlobalData) { mp.game.graphics.startScreenEffect("FocusIn", 0, false); menuBrowser = mp.browsers.new("package://assets/html/vehiclemenu/index.html"); mp.gui.chat.show(false); + globalData.InMenu = true; mp.gui.cursor.show(true, true); }); diff --git a/ReallifeGamemode.Client/Interaction/bankmenu.ts b/ReallifeGamemode.Client/Interaction/bankmenu.ts index 7c631edf..791c9899 100644 --- a/ReallifeGamemode.Client/Interaction/bankmenu.ts +++ b/ReallifeGamemode.Client/Interaction/bankmenu.ts @@ -67,46 +67,46 @@ export default function bankMenuHandle(globalData: IGlobalData) { mp.gui.chat.activate(true); mp.gui.cursor.show(true, true); globalData.InMenu = false; - globalData.InInput = true; + globalData.InMenu = true; var input = new InputHelper("Wie viel möchtest du einzahlen?", globalData); input.show(); input.getValue(amount => { mp.events.callRemote("CLIENT:payIn", amount); mp.gui.cursor.show(false, false); bankmenu.Close(true); - globalData.InInput = false; + globalData.InMenu = false; }); }else if (item.Text === "Auszahlen") { mp.gui.chat.activate(true); mp.gui.cursor.show(true, true); globalData.InMenu = false; - globalData.InInput = true; + globalData.InMenu = true; var input = new InputHelper("Wie viel möchtest du Auszahlen?", globalData); input.show(); input.getValue(amount => { mp.events.callRemote("CLIENT:payOut", amount); mp.gui.cursor.show(false, false); bankmenu.Close(true); - globalData.InInput = false; + globalData.InMenu = false; }); } else if (item.Text === "Überweisen" ) { mp.gui.chat.activate(true); mp.gui.cursor.show(true, true); globalData.InMenu = false; - globalData.InInput = true; + globalData.InMenu = true; var input = new InputHelper("Wem möchtest du Geld überweisen? (Name/ID)", globalData); input.show(); input.getValue(name => { mp.events.call("CLIENT:bank_name", name); mp.gui.cursor.show(false, false); bankmenu.Close(true); - globalData.InInput = false; + globalData.InMenu = false; }); } else if (item.Text === "Schließen") { mp.gui.cursor.show(false, false); bankmenu.Close(true); - globalData.InInput = false; + globalData.InMenu = false; } }); @@ -119,19 +119,19 @@ export default function bankMenuHandle(globalData: IGlobalData) { mp.events.add('removeBankmenu', () => { mp.gui.cursor.show(false, false); bankmenu.Close(true); - globalData.InInput = false; + globalData.InMenu = false; }); mp.events.add("CLIENT:bank_name", (name) => { paymentname = name; - globalData.InInput = true; + globalData.InMenu = true; var input = new InputHelper("Wie viel möchtest du Überweisen??", globalData); mp.gui.cursor.show(true, true); input.show(); input.getValue(amount => { mp.events.callRemote("CLIENT:payment", JSON.stringify(paymentname), amount); mp.gui.cursor.show(false, false); - globalData.InInput = false; + globalData.InMenu = false; }); }); @@ -139,7 +139,7 @@ export default function bankMenuHandle(globalData: IGlobalData) { mp.events.add('removeFactionBankmenu', () => { mp.gui.cursor.show(false, false); factionBankmenu.Close(true); - globalData.InInput = false; + globalData.InMenu = false; }); @@ -161,19 +161,19 @@ export default function bankMenuHandle(globalData: IGlobalData) { mp.gui.chat.activate(true); mp.gui.cursor.show(true, true); globalData.InMenu = false; - globalData.InInput = true; + globalData.InMenu = true; var input = new InputHelper("Wie viel möchtest du einzahlen?", globalData); input.show(); input.getValue(amount => { mp.events.callRemote("CLIENT:factionPayIn", amount); mp.gui.cursor.show(false, false); factionBankmenu.Close(true); - globalData.InInput = false; + globalData.InMenu = false; }); }else if (item.Text === "Schließen") { mp.gui.cursor.show(false, false); factionBankmenu.Close(true); - globalData.InInput = false; + globalData.InMenu = false; } }); @@ -201,32 +201,32 @@ export default function bankMenuHandle(globalData: IGlobalData) { mp.gui.chat.activate(true); mp.gui.cursor.show(true, true); globalData.InMenu = false; - globalData.InInput = true; + globalData.InMenu = true; var input = new InputHelper("Wie viel möchtest du einzahlen?", globalData); input.show(); input.getValue(amount => { mp.events.callRemote("CLIENT:factionPayIn", amount); mp.gui.cursor.show(false, false); factionBankmenu.Close(true); - globalData.InInput = false; + globalData.InMenu = false; }); }else if (item.Text === "Überweisen") { mp.gui.chat.activate(true); mp.gui.cursor.show(true, true); globalData.InMenu = false; - globalData.InInput = true; + globalData.InMenu = true; var input = new InputHelper("Wem möchtest du Geld überweisen? (Name/ID)", globalData); input.show(); input.getValue(name => { mp.events.call("CLIENT:bank_factionname", name); mp.gui.cursor.show(false, false); factionBankmenu.Close(true); - globalData.InInput = false; + globalData.InMenu = false; }); }else if (item.Text === "Schließen") { mp.gui.cursor.show(false, false); factionBankmenu.Close(true); - globalData.InInput = false; + globalData.InMenu = false; } }); @@ -238,14 +238,14 @@ export default function bankMenuHandle(globalData: IGlobalData) { mp.events.add("CLIENT:bank_factionname", (name) => { paymentname = name; - globalData.InInput = true; + globalData.InMenu = true; var input = new InputHelper("Wie viel möchtest du Überweisen?", globalData); mp.gui.cursor.show(true, true); input.show(); input.getValue(amount => { mp.events.callRemote("CLIENT:factionPayment", JSON.stringify(paymentname), amount); mp.gui.cursor.show(false, false); - globalData.InInput = false; + globalData.InMenu = false; }); }); diff --git a/ReallifeGamemode.Client/Interaction/drivingschool.ts b/ReallifeGamemode.Client/Interaction/drivingschool.ts index d7818027..11a888dc 100644 --- a/ReallifeGamemode.Client/Interaction/drivingschool.ts +++ b/ReallifeGamemode.Client/Interaction/drivingschool.ts @@ -23,7 +23,7 @@ export default function drivingSchoolList(globalData: IGlobalData) { var drivingMenu: NativeUI.Menu; - var stage = ""; + var stage = "Auto"; //Weapon Menu diff --git a/ReallifeGamemode.Client/Interaction/factioninteraction.ts b/ReallifeGamemode.Client/Interaction/factioninteraction.ts index 15acd63c..dfa95f1c 100644 --- a/ReallifeGamemode.Client/Interaction/factioninteraction.ts +++ b/ReallifeGamemode.Client/Interaction/factioninteraction.ts @@ -87,27 +87,23 @@ export default function factionInteraction(globalData: IGlobalData) { factionInteractionMenu.Visible = false; mp.gui.chat.activate(true); mp.gui.cursor.show(true, true); - globalData.InMenu = false; - globalData.InInput = true; var input = new InputHelper("Welchem Spieler möchtest du ein Ticket geben (Name / ID)?", globalData); input.show(); input.getValue(name => { mp.events.call("CLIENT:InteractionMenu_LSPD_Ticket", name); mp.gui.cursor.show(false, false); - globalData.InInput = false; + globalData.InMenu = false; }); break; case pointsTaskMenuLSPD: factionInteractionMenu.Visible = false; mp.gui.chat.activate(true); mp.gui.cursor.show(true, true); - globalData.InMenu = false; - globalData.InInput = true; var input = new InputHelper("Welchem Spieler möchtest du Strafpunkte geben (Name / ID)?", globalData); input.show(); input.getValue(name => { mp.events.call("CLIENT:InteractionMenu_LSPD_Points", name); - globalData.InInput = false; + globalData.InMenu = false; }); break case wantedsMenuLSPD: @@ -128,24 +124,24 @@ export default function factionInteraction(globalData: IGlobalData) { }); mp.events.add("CLIENT:InteractionMenu_LSPD_Ticket", (name) => { ticketName = name; - globalData.InInput = true; + globalData.InMenu = true; var input = new InputHelper("Wie hoch soll der Ticketbetrag sein ?", globalData); mp.gui.cursor.show(true, true); input.show(); input.getValue(amount => { - globalData.InInput = false; + globalData.InMenu = false; mp.events.call("CLIENT:InteractionMenu_LSPD_Ticket2", amount); mp.gui.cursor.show(false, false); }); }); mp.events.add("CLIENT:InteractionMenu_LSPD_Ticket2", (ticketPrice) => { - globalData.InInput = true; + globalData.InMenu = true; var input = new InputHelper("Um welches Vergehen handelt es sich ?", globalData); mp.gui.cursor.show(true, true); input.show(); input.getValue(ticketReason => { - globalData.InInput = false; + globalData.InMenu = false; mp.events.callRemote("CLIENT:InteractionMenu_LSPD_Ticket3", JSON.stringify(ticketName), ticketPrice, JSON.stringify(ticketReason)); mp.gui.cursor.show(false, false); }); @@ -153,12 +149,12 @@ export default function factionInteraction(globalData: IGlobalData) { mp.events.add("CLIENT:InteractionMenu_LSPD_Points", (name) => { pointsName = name; - globalData.InInput = true; + globalData.InMenu = true; var input = new InputHelper("Wieviele Punkte werden vergeben ?", globalData); mp.gui.cursor.show(true, true); input.show(); input.getValue(amount => { - globalData.InInput = false; + globalData.InMenu = false; mp.events.call("CLIENT:InteractionMenu_LSPD_Points2", amount); mp.gui.cursor.show(false, false); }); @@ -182,12 +178,12 @@ export default function factionInteraction(globalData: IGlobalData) { if (wantedlistBrowser !== null) { wantedlistBrowser.destroy(); wantedlistBrowser = null; - globalData.InInput = false; + globalData.InMenu = false; mp.gui.cursor.show(false, false); mp.gui.chat.activate(true); } - else if (!globalData.InInput) { - globalData.InInput = true; + else if (!globalData.InMenu) { + globalData.InMenu = true; wantedlistBrowser = mp.browsers.new('package://assets/html/Wantedlist/wanteds.html'); mp.gui.chat.activate(false); mp.gui.cursor.show(true, true); @@ -203,10 +199,10 @@ export default function factionInteraction(globalData: IGlobalData) { if (wantedlistBrowser == null) { return; } - else if (globalData.InInput) { + else if (globalData.InMenu) { wantedlistBrowser.destroy(); wantedlistBrowser = null; - globalData.InInput = false; + globalData.InMenu = false; mp.gui.cursor.show(false, false); mp.gui.chat.activate(true); } diff --git a/ReallifeGamemode.Client/Interaction/interactionmenu.ts b/ReallifeGamemode.Client/Interaction/interactionmenu.ts index 0fff24ac..1946fc78 100644 --- a/ReallifeGamemode.Client/Interaction/interactionmenu.ts +++ b/ReallifeGamemode.Client/Interaction/interactionmenu.ts @@ -169,21 +169,20 @@ export default function (globalData: IGlobalData) { } else if (item === payItem) { mp.gui.chat.activate(true); mp.gui.cursor.show(true, true); - globalData.InMenu = false; - globalData.InInput = true; + globalData.InMenu = true; var input = new InputHelper("Welchem Spieler möchtest du Geld geben (Name / ID)?", globalData); input.show(); input.getValue(name => { mp.events.call("CLIENT:InteractionMenu_Pay_Name", name); mp.gui.cursor.show(false, false); menu.Close(true); - globalData.InInput = false; + globalData.InMenu = false; }); } else if (item == HouseItem) { mp.events.callRemote("CLIENT:InteractionMenu_FindHouse"); mp.gui.cursor.show(false, false); menu.Close(true); - globalData.InInput = false; + globalData.InMenu = false; } }); @@ -289,13 +288,13 @@ export default function (globalData: IGlobalData) { licenseMenu.ItemSelect.on((item, index) => { if (item === showItem) { - globalData.InInput = true; + globalData.InMenu = true; var input = new InputHelper("Welchen Spieler möchtest du deine Lizenzen zeigen (Name / ID)?", globalData); input.show(); input.getValue(name => { mp.events.callRemote("CLIENT:InteractionMenu_Show", "License", name); parentMenu.Close(true); - globalData.InInput = false; + globalData.InMenu = false; }); } @@ -336,22 +335,22 @@ export default function (globalData: IGlobalData) { factionMenu.ItemSelect.on((item, index) => { if (index === 0) { // Inviten - globalData.InInput = true; + globalData.InMenu = true; var input = new InputHelper("Welchen Spieler möchtest du inviten (Name / ID)?", globalData); input.show(); input.getValue(name => { mp.events.callRemote("CLIENT:InteractionMenu_Invite", "Fraktion", name); factionMenu.Close(); - globalData.InInput = false; + globalData.InMenu = false; }); } else if (index === 1) { // Uninviten - globalData.InInput == true; + globalData.InMenu == true; var input = new InputHelper("Welchen Spieler möchtest du uninviten (Name / ID)?", globalData); input.show(); input.getValue(name => { mp.events.callRemote("CLIENT:InteractionMenu_Uninvite", "Fraktion", name); factionMenu.Close(); - globalData.InInput = false; + globalData.InMenu = false; }); } }); @@ -372,24 +371,24 @@ export default function (globalData: IGlobalData) { groupMenu.ItemSelect.on((item, index) => { switch (index) { case 0: //Spieler inviten - globalData.InInput = true; + globalData.InMenu = true; var input = new InputHelper("Welchen Spieler möchtest du inviten (Name / ID)?", globalData); input.show(); input.getValue(name => { mp.events.callRemote("CLIENT:InteractionMenu_Invite", "Gruppe", name); parentMenu.Close(); - globalData.InInput = false; + globalData.InMenu = false; }); break; case 1: //Spieler uninviten - globalData.InInput == true; + globalData.InMenu == true; var input = new InputHelper("Welchen Spieler möchtest du uninviten (Name / ID)?", globalData); input.show(); input.getValue(name => { mp.events.callRemote("CLIENT:InteractionMenu_Uninvite", "Gruppe", name); parentMenu.Close(); - globalData.InInput = false; + globalData.InMenu = false; }); break; @@ -398,13 +397,13 @@ export default function (globalData: IGlobalData) { break; case 3: //Neuen (zusätzlichen) Gruppenleiter bestimmen - globalData.InInput = true; + globalData.InMenu = true; var input = new InputHelper("Welchen Spieler soll Manager werden (Name)? ", globalData); input.show(); input.getValue(name => { mp.events.callRemote("CLIENT:InteractionMenu_MakeLeader", "Gruppe", name); parentMenu.Close(); - globalData.InInput = false; + globalData.InMenu = false; }); break; @@ -534,14 +533,14 @@ export default function (globalData: IGlobalData) { mp.events.add("CLIENT:InteractionMenu_Pay_Name", (name) => { payName = name; - globalData.InInput = true; + globalData.InMenu = true; var input = new InputHelper("Wie viel?", globalData); mp.gui.cursor.show(true, true); input.show(); input.getValue(amount => { mp.events.callRemote("CLIENT:InteractionMenu_Pay", JSON.stringify(payName), amount); mp.gui.cursor.show(false, false); - globalData.InInput = false; + globalData.InMenu = false; }); }); } diff --git a/ReallifeGamemode.Client/Interaction/worldinteraction.ts b/ReallifeGamemode.Client/Interaction/worldinteraction.ts index 554e453a..36bbabff 100644 --- a/ReallifeGamemode.Client/Interaction/worldinteraction.ts +++ b/ReallifeGamemode.Client/Interaction/worldinteraction.ts @@ -12,7 +12,7 @@ export default function worldInteraction() { mp.gui.chat.show(false); mp.game.ui.displayHud(false); mp.game.ui.displayRadar(false); - GlobalData.InInput = true; + GlobalData.InMenu = true; atmBrowser = mp.browsers.new("package://assets/html/atm/index.html"); } }); @@ -23,7 +23,7 @@ export default function worldInteraction() { mp.game.ui.displayHud(true); mp.game.ui.displayRadar(true); inAtm = false; - GlobalData.InInput = false; + GlobalData.InMenu = false; atmBrowser.destroy(); }); diff --git a/ReallifeGamemode.Client/Login/main.ts b/ReallifeGamemode.Client/Login/main.ts index c7a04afd..3fe6e020 100644 --- a/ReallifeGamemode.Client/Login/main.ts +++ b/ReallifeGamemode.Client/Login/main.ts @@ -18,7 +18,7 @@ export default function (globalData: IGlobalData): void { mp.game.ui.displayHud(false); mp.game.ui.displayRadar(false); - globalData.InInput = true; + globalData.InMenu = true; globalData.InMenu = true; disableLightMode = disableLight; @@ -65,7 +65,7 @@ export default function (globalData: IGlobalData): void { mp.game.ui.displayRadar(true); globalData.LoggedIn = true; - globalData.InInput = false; + globalData.InMenu = false; globalData.InMenu = false; loginCam.setActive(false); mp.game.cam.renderScriptCams(false, false, 0, true, false); diff --git a/ReallifeGamemode.Client/Player/freecam.ts b/ReallifeGamemode.Client/Player/freecam.ts index d17f4928..2dbe1fbe 100644 --- a/ReallifeGamemode.Client/Player/freecam.ts +++ b/ReallifeGamemode.Client/Player/freecam.ts @@ -30,7 +30,7 @@ var shiftModifier = false; var controlModifier = false; var localPlayer = mp.players.local; - mp.keys.bind(bindVirtualKeys.F2, true, function () { + mp.events.add('ADMIN:NoClip', () => { isNoClip = !isNoClip; mp.game.ui.displayRadar(!isNoClip); if (isNoClip) { diff --git a/ReallifeGamemode.Client/Player/keys.ts b/ReallifeGamemode.Client/Player/keys.ts index fa44776e..8f2e3751 100644 --- a/ReallifeGamemode.Client/Player/keys.ts +++ b/ReallifeGamemode.Client/Player/keys.ts @@ -11,9 +11,7 @@ const player = mp.players.local; export default function keys(globalData: IGlobalData) { - var showInventory = false; var showGui = true; - var showInv = false; //ENTER mp.keys.bind(0x0D, false, function () { @@ -24,21 +22,21 @@ export default function keys(globalData: IGlobalData) { //LEFT ARROW (Interaktion mit anderen Spielern) mp.keys.bind(0x25, false, function () { - if (!globalData.InChat && !showInv && !globalData.InMenu) { + if (!globalData.InChat && !globalData.InMenu && !globalData.InTuning) { mp.events.callRemote("keyPress:LEFT_ARROW"); } }); //UP ARROW (Interaktion mit Spielwelt) mp.keys.bind(0x26, false, function () { - if (!globalData.InChat && !showInv && !globalData.InMenu) { + if (!globalData.InChat && !globalData.InMenu && !globalData.InTuning) { mp.events.callRemote("keyPress:UP_ARROW"); } }); //RIGHT ARROW (Fraktionsinteraktion) mp.keys.bind(0x27, false, function () { - if (!globalData.InChat && !showInv && !globalData.InMenu) { + if (!globalData.InChat && !globalData.InMenu && !globalData.InTuning) { mp.events.callRemote("keyPress:RIGHT_ARROW"); } }); @@ -70,7 +68,7 @@ export default function keys(globalData: IGlobalData) { //E mp.keys.bind(0x45, false, function () { - if (!globalData.InChat && !globalData.InMenu) { + if (!globalData.InChat) { mp.events.callRemote("keyPress:E"); } }); @@ -78,19 +76,14 @@ export default function keys(globalData: IGlobalData) { //I //Inventar mp.keys.bind(0x49, false, function () { - if (!globalData.InChat && !globalData.InTuning && !globalData.InMenu) { - if (showInv === false) { - showInv = true; - } else { - showInv = false; - } + if (!globalData.InChat && !globalData.InTuning) { mp.events.callRemote("keyPress:I"); } }); //O //Spielerliste mp.keys.bind(0x4F, true, function () { - if (!globalData.InChat && !globalData.InMenu && !globalData.InTuning && !showInv) { + if (!globalData.InChat && !globalData.InTuning ) { mp.events.callRemote("keyPress:O"); //mp.events.call("showPlayerlist"); } @@ -98,7 +91,7 @@ export default function keys(globalData: IGlobalData) { //K //Dienstkleidung mp.keys.bind(0x4B, false, function () { - if (!globalData.InChat) { + if (!globalData.InChat && !globalData.InMenu) { mp.events.callRemote("keyPress:K"); } }); @@ -112,7 +105,7 @@ export default function keys(globalData: IGlobalData) { //M (Interaktionsmenü) mp.keys.bind(0x4D, false, function () { - if (!globalData.InChat && !showInv && !globalData.InMenu && !globalData.InInput && !globalData.InTuning) { + if (!globalData.InChat && !globalData.InTuning && !globalData.InMenu) { mp.events.callRemote("keyPress:M"); } }); @@ -128,21 +121,21 @@ export default function keys(globalData: IGlobalData) { //T mp.keys.bind(0x54, false, function () { - if (!globalData.InChat) { + if (!globalData.InChat && !globalData.InTuning && !globalData.InMenu) { globalData.InChat = true; } }); //X // Fahrzeug Verwaltung - Menü mp.keys.bind(0x58, false, function () { - if (!globalData.InChat) { + if (!globalData.InChat && !globalData.InMenu && !globalData.InTuning) { mp.events.callRemote("keyPress:X"); } }); //J // Job Starten mp.keys.bind(0x4A, false, () => { - if (!globalData.InChat && !globalData.InInput && !globalData.InMenu && globalData.LoggedIn) { + if (!globalData.InChat && globalData.LoggedIn && !globalData.InTuning) { mp.events.callRemote("CLIENT:JobManager_ShowJobMenu"); } }); @@ -150,4 +143,10 @@ export default function keys(globalData: IGlobalData) { mp.keys.bind(0x7A, false, () => { mp.gui.takeScreenshot(new Date().toLocaleDateString(), 1, 100, 80); }); + + //F2 //Noclip + mp.keys.bind(0x71, false, () => { + mp.events.callRemote("Noclip"); + + }); } \ No newline at end of file diff --git a/ReallifeGamemode.Client/Player/reportmenu.ts b/ReallifeGamemode.Client/Player/reportmenu.ts index c3a5e2d3..bee77944 100644 --- a/ReallifeGamemode.Client/Player/reportmenu.ts +++ b/ReallifeGamemode.Client/Player/reportmenu.ts @@ -107,7 +107,7 @@ export default function reportList(globalData: IGlobalData) { reportMenu.ItemSelect.on((item) => { if (item.Text === "Absenden") { - globalData.InInput = true; + globalData.InMenu = true; var ticketContentBox = new InputHelper("Worin besteht dein Anliegen?", globalData); ticketContentBox.show(); ticketContentBox.getValue(data => { diff --git a/ReallifeGamemode.Client/global.d.ts b/ReallifeGamemode.Client/global.d.ts index b5d1204c..44ec321c 100644 --- a/ReallifeGamemode.Client/global.d.ts +++ b/ReallifeGamemode.Client/global.d.ts @@ -4,7 +4,6 @@ InMenu: boolean, InChat: boolean, LoggedIn: boolean, - InInput: boolean } declare type AccountData = { diff --git a/ReallifeGamemode.Client/index.ts b/ReallifeGamemode.Client/index.ts index 012b6c70..848bcd2f 100644 --- a/ReallifeGamemode.Client/index.ts +++ b/ReallifeGamemode.Client/index.ts @@ -14,8 +14,7 @@ let globalData: IGlobalData = { InTuning: false, HideGui: false, InChat: false, - LoggedIn: false, - InInput: false, + LoggedIn: false, get InMenu(): boolean { return inMenu; @@ -142,8 +141,8 @@ keys(globalData); import quitHandler from './Player/quit'; quitHandler(); -//import freeCam from './Player/freecam'; -//freeCam(); +import freeCam from './Player/freecam'; +freeCam(); import saveManager from './Save/main'; saveManager(); diff --git a/ReallifeGamemode.Client/inputhelper/index.ts b/ReallifeGamemode.Client/inputhelper/index.ts index 5ea5a963..ce216572 100644 --- a/ReallifeGamemode.Client/inputhelper/index.ts +++ b/ReallifeGamemode.Client/inputhelper/index.ts @@ -36,7 +36,6 @@ export default class InputHelper { show() { if (this.created) return; this.data.InMenu = true; - this.data.InInput = true; this.created = true; this.browser = mp.browsers.new('package://assets/html/inputhelper/index.html'); mp.gui.cursor.show(true, true); @@ -50,7 +49,6 @@ export default class InputHelper { mp.events.remove('cef_request_title'); mp.events.remove('closeinputhelper'); this.browser.destroy(); - this.data.InInput = false; this.data.InMenu = false; this.created = false; this.browser = null; diff --git a/ReallifeGamemode.Client/inventory/inventory.ts b/ReallifeGamemode.Client/inventory/inventory.ts index af7b28d7..964068e7 100644 --- a/ReallifeGamemode.Client/inventory/inventory.ts +++ b/ReallifeGamemode.Client/inventory/inventory.ts @@ -15,14 +15,12 @@ if (invBrowser !== null) { invBrowser.destroy() invBrowser = null; - globalData.InInput = false; globalData.InMenu = false; loaded = false; mp.gui.cursor.show(false, false); return; } if (!globalData.InMenu) { - globalData.InInput = true; globalData.InMenu = true; mp.gui.cursor.show(true, true); itemArr = []; @@ -38,7 +36,6 @@ var tradeItemWeight; mp.events.add('openInventory', () => { - globalData.InInput = true; globalData.InMenu = true; mp.gui.cursor.show(true, true); itemArr = []; @@ -48,7 +45,6 @@ mp.events.add('closeInventory', () => { invBrowser.destroy() invBrowser = null; - globalData.InInput = false; globalData.InMenu = false; loaded = false; mp.gui.cursor.show(false, false); diff --git a/ReallifeGamemode.Client/util/attachmentMngr.ts b/ReallifeGamemode.Client/util/attachmentMngr.ts index 1cc1579f..60ba0235 100644 --- a/ReallifeGamemode.Client/util/attachmentMngr.ts +++ b/ReallifeGamemode.Client/util/attachmentMngr.ts @@ -32,7 +32,13 @@ export default function attachmentManager(game: IGame) { } else if (entityRage.type === "vehicle") { var vehicle = game.vehicles.at(entityRage.remoteId); entity = vehicle; - } + var realName = mp.game.ui.getLabelText(mp.game.vehicle.getDisplayNameFromVehicleModel(entityRage.model)); + } else if (entityRage.type === "object") { + return; + } + + + let e = game.attachments.get(entity); @@ -59,7 +65,7 @@ export default function attachmentManager(game: IGame) { rotation: attInfo.rotation }; - game.objects.setData(rageObject, attachmentData); + game.objects.setData(rageObject, attachmentData); // hier hakt es mein freund let object = game.objects.at(rageObject.remoteId); @@ -258,6 +264,7 @@ export default function attachmentManager(game: IGame) { if (e != null) { if (e.__attachmentObjects) { + //game.wait(2500); attachmentMngr.shutdownFor(entityRage); } } diff --git a/ReallifeGamemode.Client/util/drivingschool.ts b/ReallifeGamemode.Client/util/drivingschool.ts index ef5133f4..c36e0ee8 100644 --- a/ReallifeGamemode.Client/util/drivingschool.ts +++ b/ReallifeGamemode.Client/util/drivingschool.ts @@ -116,7 +116,7 @@ export default function drivingSchoolHandle(globalData: IGlobalData) { }; function keyPressHandler() { - if (globalData.InChat || globalData.InInput || globalData.InMenu) return; + if (globalData.InChat || globalData.InMenu || globalData.InMenu) return; mp.events.call('removeDrivingSchoolMenu', false); mp.events.call('showDrivingSchoolSelector'); diff --git a/ReallifeGamemode.Client/util/planeschool.ts b/ReallifeGamemode.Client/util/planeschool.ts index 54d5b376..992b871e 100644 --- a/ReallifeGamemode.Client/util/planeschool.ts +++ b/ReallifeGamemode.Client/util/planeschool.ts @@ -62,7 +62,7 @@ export default function planeSchoolHandle(globalData: IGlobalData) { }; function keyPressHandler() { - if (globalData.InChat || globalData.InInput || globalData.InMenu) return; + if (globalData.InChat || globalData.InMenu) return; mp.events.call('removeplaneSchoolMenu', false); mp.events.callRemote('startplaneSchool'); diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 1a99b053..49212db0 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -3650,5 +3650,17 @@ namespace ReallifeGamemode.Server.Commands } #endregion ALevel1338 + + [RemoteEvent("Noclip")] + public void Noclip(Player player) + { + if (!player.GetUser()?.IsAdmin(AdminLevel.HEADADMIN) ?? true) + { + return; + } + if(player.HasData("Adminduty") && player.GetData("Adminduty")) + player.TriggerEvent("ADMIN:NoClip"); + } + } } diff --git a/ReallifeGamemode.Server/Commands/FactionCommands.cs b/ReallifeGamemode.Server/Commands/FactionCommands.cs index c0668be5..c5668041 100644 --- a/ReallifeGamemode.Server/Commands/FactionCommands.cs +++ b/ReallifeGamemode.Server/Commands/FactionCommands.cs @@ -323,6 +323,12 @@ namespace ReallifeGamemode.Server.Commands return; } + if(player.Position.DistanceTo(target.Position) > 3) + { + ChatService.ErrorMessage(player, "Der Patient ist zu weit entfernt"); + return; + } + if (price < 10 || price > 100) { ChatService.ErrorMessage(player, "Der Preis muss zwischen 10$ und 100$ liegen"); diff --git a/ReallifeGamemode.Server/Commands/UserCommands.cs b/ReallifeGamemode.Server/Commands/UserCommands.cs index 91dabc04..00412237 100644 --- a/ReallifeGamemode.Server/Commands/UserCommands.cs +++ b/ReallifeGamemode.Server/Commands/UserCommands.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using GTANetworkAPI; using ReallifeGamemode.Database.Entities; +using ReallifeGamemode.Database.Models; using ReallifeGamemode.Server.Extensions; using ReallifeGamemode.Server.Finance; using ReallifeGamemode.Server.Managers; @@ -15,6 +16,16 @@ namespace ReallifeGamemode.Server.Commands { internal class UserCommands : Script { + + [Command("skill")] + public void CmdUserSkill(Player player) + { + User user = player.GetUser(new DatabaseContext()); + + player.SendChatMessage($"~c~BusSkill = {user.BusSkill}/800, PilotSkill = {user.PilotSkill}/300."); + + } + [Command("id", "~m~Benutzung: ~s~/id [Name]")] public void CmdUserId(Player player, String targetname) { diff --git a/ReallifeGamemode.Server/Managers/ATMManager.cs b/ReallifeGamemode.Server/Managers/ATMManager.cs index 927fc88e..2fab284c 100644 --- a/ReallifeGamemode.Server/Managers/ATMManager.cs +++ b/ReallifeGamemode.Server/Managers/ATMManager.cs @@ -112,7 +112,11 @@ namespace ReallifeGamemode.Server.Managers //client.TriggerEvent("SERVER:WORLD_INTERACTION:ATM_ERROR", 0, checkATM.Balance); client.SendNotification("~r~Nicht genügend Geld auf der Hand!"); } - else + else if(inputField1 < 0) + { + client.SendNotification("~r~Ungültiger Betrag!"); + } + else { var updateBankMoneyIn = user.BankAccount; var updateATMBalanceIn = dbContext.ATMs.FirstOrDefault(a => a.Id == nearATM);