From 86f594fc099bec07b9eb1129c46068a6d22471b1 Mon Sep 17 00:00:00 2001 From: kookroach <62265045+kookroach@users.noreply.github.com> Date: Sun, 4 Apr 2021 19:12:55 +0200 Subject: [PATCH] fix --- ReallifeGamemode.Client/Gui/licenses.ts | 2 +- .../Interaction/clothes/ClotheShop.ts | 7 +++---- ReallifeGamemode.Server.Core/Menus/PoliceDepartment.cs | 6 +++++- ReallifeGamemode.Server/Managers/InteractionManager.cs | 10 ++++++---- .../WeaponDeal/WeaponDealManager.cs | 2 +- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/ReallifeGamemode.Client/Gui/licenses.ts b/ReallifeGamemode.Client/Gui/licenses.ts index e48a0eea..4222b3e4 100644 --- a/ReallifeGamemode.Client/Gui/licenses.ts +++ b/ReallifeGamemode.Client/Gui/licenses.ts @@ -20,7 +20,7 @@ export default function licenses(globalData: IGlobalData): void { mp.events.add("CEF:LicenseLoaded", () => { licenseBrowser.execute(`add_licenses('${JSON.stringify(globalInfo)}');`); licenseBrowser.execute(`add_licensesholder('${JSON.stringify(globalName)}');`); - licenseTimer = setInterval(DestroyLicenses, 7000); + licenseTimer = setInterval(DestroyLicenses, 15000); }); diff --git a/ReallifeGamemode.Client/Interaction/clothes/ClotheShop.ts b/ReallifeGamemode.Client/Interaction/clothes/ClotheShop.ts index 4aef566b..a34b8665 100644 --- a/ReallifeGamemode.Client/Interaction/clothes/ClotheShop.ts +++ b/ReallifeGamemode.Client/Interaction/clothes/ClotheShop.ts @@ -183,8 +183,7 @@ export default function clotheShopList(globalData: IGlobalData) { var txData = getClothingName(key, item.ClotheId, gender); - mp.gui.chat.push('Key ' + key); - mp.gui.chat.push(item); + if (txData != undefined && txData.length > 0) { categoryMenu.AddItem(new UIMenuItem(mp.game.ui.getLabelText(txData[0].data[0].GXT), "")); @@ -419,7 +418,7 @@ export default function clotheShopList(globalData: IGlobalData) { nextMenu.Visible = true; menuTransition = true; - submenuItemChangeHandler(nextMenu.menu.CurrentSelection); + // submenuItemChangeHandler(nextMenu.menu.CurrentSelection); }); mainMenu.MenuClose.on(() => { @@ -449,7 +448,7 @@ export default function clotheShopList(globalData: IGlobalData) { nextMenu.menu.Visible = true; menuTransition = true; - //submenuItemChangeHandler(nextMenu.menu.CurrentSelection); + submenuItemChangeHandler(nextMenu.menu.CurrentSelection); }); categoryMenu.MenuClose.on(() => { diff --git a/ReallifeGamemode.Server.Core/Menus/PoliceDepartment.cs b/ReallifeGamemode.Server.Core/Menus/PoliceDepartment.cs index 5ab97028..f4c5da37 100644 --- a/ReallifeGamemode.Server.Core/Menus/PoliceDepartment.cs +++ b/ReallifeGamemode.Server.Core/Menus/PoliceDepartment.cs @@ -4,7 +4,8 @@ using System.Text; using ReallifeGamemode.Server.Core.API; using ReallifeGamemode.Server.Types; using ReallifeGamemode.Server.Core.Extensions; - +using Microsoft.EntityFrameworkCore; +using System.Linq; namespace ReallifeGamemode.Server.Core.Menus { @@ -49,6 +50,9 @@ namespace ReallifeGamemode.Server.Core.Menus player.SendMessage("Du hast den Waffenschein erfolgreich erworben.", ChatPrefix.Info); + dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == 1).First().BankAccount.Balance += 2500; + dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == 3).First().BankAccount.Balance += 2500; + user.WeaponLicense = true; dbContext.SaveChanges(); } diff --git a/ReallifeGamemode.Server/Managers/InteractionManager.cs b/ReallifeGamemode.Server/Managers/InteractionManager.cs index 1b7c184a..8675816d 100644 --- a/ReallifeGamemode.Server/Managers/InteractionManager.cs +++ b/ReallifeGamemode.Server/Managers/InteractionManager.cs @@ -630,7 +630,7 @@ namespace ReallifeGamemode.Server.Managers } else { - if (amount > -9 && amount < 9) + if (amount > -13 && amount < 13) { using (var dbContext = new DatabaseContext()) { @@ -640,6 +640,7 @@ namespace ReallifeGamemode.Server.Managers } player.SendNotification($"~w~Du hast ~y~{targetname} ~b~{amount} ~w~Strafpunkte gegeben. Grund: ~g~{reason}~w~."); target.SendNotification($"~b~{player.GetUser().FactionRank.RankName} | {playername} ~w~hat dir ~y~{amount} ~w~Strafpunkte gegeben.", true); + ChatService.BroadcastFaction("~y~" + targetname + "~b~ hat von ~g~" + playername + " ~y~" + amount + " ~b~Strafpunkt erhalten. Gesamt: ~y~" + target.GetUser().Points, new List() { 1, 3 }); if (target.GetUser().Points < 0) { using (var dbContext = new DatabaseContext()) @@ -649,10 +650,11 @@ namespace ReallifeGamemode.Server.Managers dbContext.SaveChanges(); } } - else if (target.GetUser().Points >= 8) + else if (target.GetUser().Points >= 12) { - target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Du hast nun ~r~8/8 ~x~Strafpunkten.", true); + target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Du hast nun ~r~12/12 ~x~Strafpunkten.", true); target.SendNotification($"~w~Dir wird ~r~Auto- ~w~und ~r~Motorradführerschein ~w~entzogen.", true); + ChatService.BroadcastFaction("~y~" + targetname + "~b~ hat von ~g~" + playername + " ~y~" + amount + " ~b~Strafpunkt erhalten. Gesamt: ~y~" + target.GetUser().Points, new List() { 1, 3 }); foreach (var copPlayer in NAPI.Pools.GetAllPlayers()) { User copUser = copPlayer.GetUser(); @@ -680,7 +682,7 @@ namespace ReallifeGamemode.Server.Managers } else { - target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Du hast nun ~y~{target.GetUser().Points}/8 ~x~Strafpunkten.", true); + target.SendNotification($"~w~Grund: ~g~{reason}~w~. ~x~Du hast nun ~y~{target.GetUser().Points}/12 ~x~Strafpunkten.", true); } } else diff --git a/ReallifeGamemode.Server/WeaponDeal/WeaponDealManager.cs b/ReallifeGamemode.Server/WeaponDeal/WeaponDealManager.cs index 737b70ad..77bbe84a 100644 --- a/ReallifeGamemode.Server/WeaponDeal/WeaponDealManager.cs +++ b/ReallifeGamemode.Server/WeaponDeal/WeaponDealManager.cs @@ -14,7 +14,7 @@ namespace ReallifeGamemode.Server.WeaponDeal { private const int WEAPON_AMOUNT_GANG = 2; private const int WEAPON_AMOUNT_COP = 8; - private const int WEAPON_AMOUNT_COP_STUNGUN = 2; + private const int WEAPON_AMOUNT_COP_STUNGUN = 12; public static bool checkWeaponDbyVehicle(Vehicle vehicle) { if (!vehicle.HasData("WeaponDealLoad") || vehicle.GetData("WeaponDealLoad") == false)