From 4ec48757015460c74517bdf52ac28317dcbac543 Mon Sep 17 00:00:00 2001 From: hydrant Date: Sun, 11 Apr 2021 14:17:50 +0200 Subject: [PATCH 01/15] reset wanted escape timer when abtauchen --- ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs b/ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs index f92f11ca..16786f60 100644 --- a/ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs +++ b/ReallifeGamemode.Server/Wanted/WantedEscapeTimer.cs @@ -15,6 +15,8 @@ namespace ReallifeGamemode.Server.Wanted { public class WantedEscapeTimer { + private const int WantedEscapeTime = 300000; + public static Dictionary waTimer { get; set; } = new Dictionary(); //zeit in ms /* public static void WantedTimer() @@ -31,7 +33,7 @@ namespace ReallifeGamemode.Server.Wanted if (user.FactionId == 1 || user.FactionId == 3) return; - waTimer[user.Id] = 300000; + waTimer[user.Id] = WantedEscapeTime; } public static void Timer_Elapsed() @@ -77,9 +79,9 @@ namespace ReallifeGamemode.Server.Wanted user.SetBlipAndNametagColor(); } dbContext.SaveChanges(); + waTimer[user.Id] = WantedEscapeTime; } - - if (!isNearCop) + else if (!isNearCop) waTimer[user.Id] -= 2500; } } From e82d467d4e40d21eab3e9360f30442b26cf56df4 Mon Sep 17 00:00:00 2001 From: hydrant Date: Sun, 11 Apr 2021 14:20:29 +0200 Subject: [PATCH 02/15] userbankaccount balancechanged dont crash server --- ReallifeGamemode.Server/Finance/Economy.cs | 26 ++++++++++++---------- ReallifeGamemode.Server/Main.cs | 14 ++++++++++-- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/ReallifeGamemode.Server/Finance/Economy.cs b/ReallifeGamemode.Server/Finance/Economy.cs index f8d0672f..78284419 100644 --- a/ReallifeGamemode.Server/Finance/Economy.cs +++ b/ReallifeGamemode.Server/Finance/Economy.cs @@ -187,21 +187,23 @@ namespace ReallifeGamemode.Server.Finance public static void Timer_Elapsed() { using var dbContext = new DatabaseContext(); - foreach (var player in NAPI.Pools.GetAllPlayers()) + foreach (var player in NAPI.Pools.GetAllPlayers().Where(p => p.IsLoggedIn())) { User user = player.GetUser(dbContext); - if (player.IsLoggedIn()) + if(user == null) { - user.PlayedMinutes += 1; - if (user.PaydayTimer <= 0) - { - Economy.SetPaycheck(player); - user.PaydayTimer = 60; - } - else if (user.PaydayTimer > 0) - { - user.PaydayTimer -= 1; - } + continue; + } + + user.PlayedMinutes += 1; + if (user.PaydayTimer <= 0) + { + Economy.SetPaycheck(player); + user.PaydayTimer = 60; + } + else if (user.PaydayTimer > 0) + { + user.PaydayTimer -= 1; } } dbContext.SaveChanges(); diff --git a/ReallifeGamemode.Server/Main.cs b/ReallifeGamemode.Server/Main.cs index 6e5e1f23..ec1afb62 100644 --- a/ReallifeGamemode.Server/Main.cs +++ b/ReallifeGamemode.Server/Main.cs @@ -172,8 +172,18 @@ namespace ReallifeGamemode.Server using (var dbContext = new DatabaseContext()) { var user = dbContext.Users.Where(u => u.BankAccountId == account.Id).Select(u => u.Name).FirstOrDefault(); - if (user == null) return; - PlayerService.GetPlayerByNameOrId(user).TriggerEvent("updateMoney", account.Balance); + if (user == null) + { + return; + } + + Player player = PlayerService.GetPlayerByNameOrId(user); + if(player == null) + { + return; + } + + player.TriggerEvent("updateMoney", account.Balance); } }; From fedf8138c41541c6b66fd0813030627277e7daac Mon Sep 17 00:00:00 2001 From: hydrant Date: Sun, 11 Apr 2021 14:26:08 +0200 Subject: [PATCH 03/15] anticheat weapon debug --- ReallifeGamemode.Client/admin/anticheat.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/ReallifeGamemode.Client/admin/anticheat.ts b/ReallifeGamemode.Client/admin/anticheat.ts index a5a248d6..2eace14c 100644 --- a/ReallifeGamemode.Client/admin/anticheat.ts +++ b/ReallifeGamemode.Client/admin/anticheat.ts @@ -153,6 +153,7 @@ if (allowedWeaponHashes.indexOf(h) === -1) { return true } + mp.gui.chat.push("unallowed weapon: " + h); return false } resetWeapon() { From bfcb07ebd84f326190e4c3603743dc1dbc9dc941 Mon Sep 17 00:00:00 2001 From: hydrant Date: Sun, 11 Apr 2021 14:36:23 +0200 Subject: [PATCH 04/15] fix unallowed wepaon --- ReallifeGamemode.Client/admin/anticheat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReallifeGamemode.Client/admin/anticheat.ts b/ReallifeGamemode.Client/admin/anticheat.ts index 2eace14c..a6834688 100644 --- a/ReallifeGamemode.Client/admin/anticheat.ts +++ b/ReallifeGamemode.Client/admin/anticheat.ts @@ -151,9 +151,9 @@ checkWeaponhash() { let h = this.weapon; if (allowedWeaponHashes.indexOf(h) === -1) { + mp.gui.chat.push("unallowed weapon: " + h); return true } - mp.gui.chat.push("unallowed weapon: " + h); return false } resetWeapon() { From a13b4057489df63cade325c5c7045bb940a74ed3 Mon Sep 17 00:00:00 2001 From: hydrant Date: Sun, 11 Apr 2021 14:43:18 +0200 Subject: [PATCH 05/15] add assaultrifle anticheat --- ReallifeGamemode.Client/admin/anticheat.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReallifeGamemode.Client/admin/anticheat.ts b/ReallifeGamemode.Client/admin/anticheat.ts index a6834688..078a8b86 100644 --- a/ReallifeGamemode.Client/admin/anticheat.ts +++ b/ReallifeGamemode.Client/admin/anticheat.ts @@ -22,7 +22,8 @@ -1716589765, -2084633992, -1075685676, - -1786099057 + -1786099057, + -1074790547 ] mp.events.add("playerJoin", () => { From 62d7e848dcd67569edfdf816f08bd158c250a328 Mon Sep 17 00:00:00 2001 From: hydrant Date: Sun, 11 Apr 2021 14:52:23 +0200 Subject: [PATCH 06/15] fix jobcar respawn --- ReallifeGamemode.Server/Job/BusDriverJob.cs | 7 +++++-- ReallifeGamemode.Server/Job/PilotJob.cs | 10 ++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ReallifeGamemode.Server/Job/BusDriverJob.cs b/ReallifeGamemode.Server/Job/BusDriverJob.cs index 1008dde3..e8eee500 100644 --- a/ReallifeGamemode.Server/Job/BusDriverJob.cs +++ b/ReallifeGamemode.Server/Job/BusDriverJob.cs @@ -421,9 +421,12 @@ namespace ReallifeGamemode.Server.Job _CHANGING_VEHICLE.Add(player); if (playerVehiclePair.ContainsKey(player)) { + Vehicle previousVehicle = null; if (playerVehiclePair[player] != null) - playerVehiclePair[player].Delete(); + previousVehicle = playerVehiclePair[player]; playerVehiclePair.Remove(player); + + previousVehicle?.Delete(); } playerVehiclePair.Add(player, vehicle); @@ -556,7 +559,7 @@ namespace ReallifeGamemode.Server.Job public override void StartJobEndTimer(Player player) { - if (!playerVehiclePair.ContainsKey(player) || _CHANGING_VEHICLE.Contains(player)) + if (!playerVehiclePair.ContainsKey(player) && _CHANGING_VEHICLE.Contains(player)) { _CHANGING_VEHICLE.Remove(player); return; diff --git a/ReallifeGamemode.Server/Job/PilotJob.cs b/ReallifeGamemode.Server/Job/PilotJob.cs index b40c6e8f..32b8d941 100644 --- a/ReallifeGamemode.Server/Job/PilotJob.cs +++ b/ReallifeGamemode.Server/Job/PilotJob.cs @@ -233,13 +233,15 @@ namespace ReallifeGamemode.Server.Job _CHANGING_VEHICLE.Add(player); if (playerVehiclePair.ContainsKey(player)) { + Vehicle previousVehicle = null; if (playerVehiclePair[player] != null) - playerVehiclePair[player].Delete(); + previousVehicle = playerVehiclePair[player]; playerVehiclePair.Remove(player); + + previousVehicle?.Delete(); } playerVehiclePair.Add(player, vehicle); player.SetIntoVehicle(vehicle.Handle, 0); - _CHANGING_VEHICLE.Remove(player); CheckPointHandle.StartCheckPointRoute(player, selectedRoute, 0, CHECKPOINT_MARKER_ID, 40, 10, true, "PILOT:InCheckpoint"); //6, 23, 25, 26, 27, 28 } @@ -286,7 +288,11 @@ namespace ReallifeGamemode.Server.Job public override void StartJobEndTimer(Player player) { if (!playerVehiclePair.ContainsKey(player) && _CHANGING_VEHICLE.Contains(player)) + { + _CHANGING_VEHICLE.Remove(player); return; + } + if (JobManager.playerTimersJobVehicleRespawn.ContainsKey(player)) { From 0a02b3d508e9ffa50dc62520db4ba27c6117ef11 Mon Sep 17 00:00:00 2001 From: hydrant Date: Sun, 11 Apr 2021 15:20:29 +0200 Subject: [PATCH 07/15] frakcar kaufen 1,5 multiplikator --- ReallifeGamemode.Server/Extensions/IntegerExtension.cs | 5 +++++ ReallifeGamemode.Server/Managers/BusinessManager.cs | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ReallifeGamemode.Server/Extensions/IntegerExtension.cs b/ReallifeGamemode.Server/Extensions/IntegerExtension.cs index 6a62a509..743f06ad 100644 --- a/ReallifeGamemode.Server/Extensions/IntegerExtension.cs +++ b/ReallifeGamemode.Server/Extensions/IntegerExtension.cs @@ -11,5 +11,10 @@ { return "$" + string.Format(Main.SERVER_CULTURE, "{0:C0}", money).Replace("€", "").Trim(); } + + public static string ToMoneyString(this double money) + { + return ((int)money).ToMoneyString(); + } } } diff --git a/ReallifeGamemode.Server/Managers/BusinessManager.cs b/ReallifeGamemode.Server/Managers/BusinessManager.cs index 875d3c9a..77ad2d06 100644 --- a/ReallifeGamemode.Server/Managers/BusinessManager.cs +++ b/ReallifeGamemode.Server/Managers/BusinessManager.cs @@ -19,6 +19,8 @@ namespace ReallifeGamemode.Server.Managers { public static List Businesses { get; private set; } + private const double FACTION_CAR_MULTIPLIER = 1.5; + public static void LoadBusinesses() { Businesses = new List(); @@ -199,10 +201,10 @@ namespace ReallifeGamemode.Server.Managers else if (target == "Fraktion") { var faction = dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Id == u.FactionId).First(); - TransactionResult result = BankManager.TransferMoney(faction, business, price * 3, "Auto gekauft", dbContext); + TransactionResult result = BankManager.TransferMoney(faction, business, (int)(price * FACTION_CAR_MULTIPLIER), "Auto gekauft", dbContext); if (result == TransactionResult.SENDER_NOT_ENOUGH_MONEY) { - player.SendNotification("~r~Die Fraktion hat nicht genug Geld: " + (price * 3).ToMoneyString()); + player.SendNotification("~r~Die Fraktion hat nicht genug Geld: " + (price * FACTION_CAR_MULTIPLIER).ToMoneyString()); return; } player.SendChatMessage("~y~Deine Fraktion hat das Fahrzeug erfolgreich gekauft"); From d27b205242ce9dc0159d43e3176750f43e70b456 Mon Sep 17 00:00:00 2001 From: hydrant Date: Sun, 11 Apr 2021 15:22:44 +0200 Subject: [PATCH 08/15] inventar test --- .../html/inventory/img/inventory/104.svg | 96 +++++++++++++++++++ .../Inventory/Items/AviateChips.cs | 18 ++++ 2 files changed, 114 insertions(+) create mode 100644 ReallifeGamemode.Client/assets/html/inventory/img/inventory/104.svg create mode 100644 ReallifeGamemode.Server/Inventory/Items/AviateChips.cs diff --git a/ReallifeGamemode.Client/assets/html/inventory/img/inventory/104.svg b/ReallifeGamemode.Client/assets/html/inventory/img/inventory/104.svg new file mode 100644 index 00000000..52ebf76b --- /dev/null +++ b/ReallifeGamemode.Client/assets/html/inventory/img/inventory/104.svg @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ReallifeGamemode.Server/Inventory/Items/AviateChips.cs b/ReallifeGamemode.Server/Inventory/Items/AviateChips.cs new file mode 100644 index 00000000..e663d6cb --- /dev/null +++ b/ReallifeGamemode.Server/Inventory/Items/AviateChips.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ReallifeGamemode.Server.Inventory.Items +{ + class AChips : FoodItem + { + public override int Id => 104; + public override string Name => "Aviates Chips"; + public override string Description => "aviate liebt sie."; + public override int Gewicht => 10; + public override string Einheit => "g"; + public override int HpAmount => 10; + public override uint Object => 2240524752; + public override int Price => 20; + } +} From 30a6b6c4a3cb0be04f855bca65ff73c95750dc56 Mon Sep 17 00:00:00 2001 From: hydrant Date: Sun, 11 Apr 2021 15:33:20 +0200 Subject: [PATCH 09/15] tog connect --- ReallifeGamemode.Server/Commands/AdminCommands.cs | 13 ++++++++++++- ReallifeGamemode.Server/Events/Connect.cs | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 17eb64a8..f210b420 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -232,7 +232,7 @@ namespace ReallifeGamemode.Server.Commands #region Support - [Command("tog", "~m~Benutzung: ~s~/tog [Typ = ~g~IP~s~, ~g~deathlogs~s~, ~g~LC~s~]", GreedyArg = true)] + [Command("tog", "~m~Benutzung: ~s~/tog [Typ = ~g~IP~s~, ~g~deathlogs~s~, ~g~LC~s~, ~g~Connect~s~]", GreedyArg = true)] public void CmdTog(Player player, string typ, string option1 = null, string option2 = null) { if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true) @@ -280,6 +280,17 @@ namespace ReallifeGamemode.Server.Commands player.SetData("toglc", true); player.SendNotification("~g~[Info]~w~ Leaderchat wird nun angezeigt."); } + case "connect": + if (player.HasData("togconnect")) + { + player.ResetData("togconnect"); + player.SendNotification("~g~[Info]~w~ Connect-Logs werden nun ausgeblendet."); + } + else + { + player.SetData("togconnect", true); + player.SendNotification("~g~[Info]~w~ Connect-Logs werden nun angezeigt."); + } break; } } diff --git a/ReallifeGamemode.Server/Events/Connect.cs b/ReallifeGamemode.Server/Events/Connect.cs index 083b1542..bfb5dd3e 100644 --- a/ReallifeGamemode.Server/Events/Connect.cs +++ b/ReallifeGamemode.Server/Events/Connect.cs @@ -81,7 +81,7 @@ namespace ReallifeGamemode.Server.Events player.TriggerEvent("SERVER:Login_ShowBrowser", registered, disableLightMode); string msg = "~m~*** " + player.Name + " [" + player.SocialClubName + "] [ID: " + player.Handle.Value + "] (" + player.Address + ")"; - if (player.HasData("togip")) + if(player.HasData("togconnect")) { ChatService.SendMessage(player, msg); } From 6a186635b52ea000cc19f2bb2d20516734c198f3 Mon Sep 17 00:00:00 2001 From: hydrant Date: Sun, 11 Apr 2021 15:39:25 +0200 Subject: [PATCH 10/15] fix connect logs --- ReallifeGamemode.Server/Commands/AdminCommands.cs | 1 + ReallifeGamemode.Server/Events/Connect.cs | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index f210b420..6d8e1438 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -280,6 +280,7 @@ namespace ReallifeGamemode.Server.Commands player.SetData("toglc", true); player.SendNotification("~g~[Info]~w~ Leaderchat wird nun angezeigt."); } + break; case "connect": if (player.HasData("togconnect")) { diff --git a/ReallifeGamemode.Server/Events/Connect.cs b/ReallifeGamemode.Server/Events/Connect.cs index bfb5dd3e..7852a425 100644 --- a/ReallifeGamemode.Server/Events/Connect.cs +++ b/ReallifeGamemode.Server/Events/Connect.cs @@ -80,11 +80,16 @@ namespace ReallifeGamemode.Server.Events bool disableLightMode = currentTime > LightModeTimeFrom && currentTime < LightModeTimeTo; player.TriggerEvent("SERVER:Login_ShowBrowser", registered, disableLightMode); - string msg = "~m~*** " + player.Name + " [" + player.SocialClubName + "] [ID: " + player.Handle.Value + "] (" + player.Address + ")"; - if(player.HasData("togconnect")) - { - ChatService.SendMessage(player, msg); - } + string msg = "~m~*** " + player.Name + " [" + player.SocialClubName + "] [ID: " + player.Handle.Value + "]"; + string ipMsg = " (" + player.Address + ")"; + ChatService.BroadcastAdmin(msg, AdminLevel.SUPPORTER, getAddInfoMessage: admin => + { + return admin.HasData("togip") ? ipMsg : string.Empty; + }, + shouldSendMessage: admin => + { + return admin.HasData("togconnect"); + }); } private bool IsPlayerBanned(Player player) From 72376c82aa3a5ec75db3b19eaf4634bacbad1fbb Mon Sep 17 00:00:00 2001 From: hydrant Date: Sun, 11 Apr 2021 15:45:04 +0200 Subject: [PATCH 11/15] fix tog --- ReallifeGamemode.Server/Services/ChatService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ReallifeGamemode.Server/Services/ChatService.cs b/ReallifeGamemode.Server/Services/ChatService.cs index e1b62f63..6096b571 100644 --- a/ReallifeGamemode.Server/Services/ChatService.cs +++ b/ReallifeGamemode.Server/Services/ChatService.cs @@ -108,9 +108,11 @@ namespace ReallifeGamemode.Server.Services } } + string toSend = message; + if(getAddInfoMessage != null) { - message += getAddInfoMessage(p); + toSend += getAddInfoMessage(p); } ChatService.SendMessage(p, message); From 997d5a02761ce23bc4aa82a68ea4579ef7a3c5e6 Mon Sep 17 00:00:00 2001 From: hydrant Date: Sun, 11 Apr 2021 15:48:07 +0200 Subject: [PATCH 12/15] fix broadcast --- ReallifeGamemode.Server/Services/ChatService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReallifeGamemode.Server/Services/ChatService.cs b/ReallifeGamemode.Server/Services/ChatService.cs index 6096b571..c4584315 100644 --- a/ReallifeGamemode.Server/Services/ChatService.cs +++ b/ReallifeGamemode.Server/Services/ChatService.cs @@ -115,7 +115,7 @@ namespace ReallifeGamemode.Server.Services toSend += getAddInfoMessage(p); } - ChatService.SendMessage(p, message); + ChatService.SendMessage(p, toSend); } }); } From c84e3bf6f3c3baa6cbaa417f4f364689257a9d7a Mon Sep 17 00:00:00 2001 From: hydrant Date: Sun, 11 Apr 2021 15:51:53 +0200 Subject: [PATCH 13/15] fix kick skick name --- ReallifeGamemode.Server/Commands/AdminCommands.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 6d8e1438..fb46010a 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -491,7 +491,7 @@ namespace ReallifeGamemode.Server.Commands target.Kick(); }, 2500); - ChatService.BroadcastAdmin("~y~SKICK: ~w~" + targetname + " wurde von " + player.GetUser().AdminLevel.GetName() + " " + adminPlayername + " gekickt: " + reason, AdminLevel.SUPPORTER); + ChatService.BroadcastAdmin("~y~SKICK: ~w~" + target.Name + " wurde von " + player.GetUser().AdminLevel.GetName() + " " + adminPlayername + " gekickt: " + reason, AdminLevel.SUPPORTER); } [Command("clearchat", "~m~Benutzung: ~s~/clearchat")] @@ -811,7 +811,7 @@ namespace ReallifeGamemode.Server.Commands target.Kick(); }, 2500); - ChatService.Broadcast("~y~INFO: ~w~" + targetname + " wurde von " + player.GetUser().AdminLevel.GetName() + " " + adminPlayername + " gekickt: " + reason); + ChatService.Broadcast("~y~INFO: ~w~" + target.Name + " wurde von " + player.GetUser().AdminLevel.GetName() + " " + adminPlayername + " gekickt: " + reason); } [Command("warn", "~m~Benutzung: ~s~/warn [Player] [Grund]", GreedyArg = true)] From 110107f27ce7f71fbc77bb1a4ad3710eb3bb5bcd Mon Sep 17 00:00:00 2001 From: hydrant Date: Sun, 11 Apr 2021 15:58:58 +0200 Subject: [PATCH 14/15] fix faction bank as zivi --- ReallifeGamemode.Client/Interaction/bankmenu.ts | 8 +++++--- ReallifeGamemode.Server/Bank/bank.cs | 10 +++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ReallifeGamemode.Client/Interaction/bankmenu.ts b/ReallifeGamemode.Client/Interaction/bankmenu.ts index 791c9899..b886c0a6 100644 --- a/ReallifeGamemode.Client/Interaction/bankmenu.ts +++ b/ReallifeGamemode.Client/Interaction/bankmenu.ts @@ -137,9 +137,11 @@ export default function bankMenuHandle(globalData: IGlobalData) { mp.events.add('removeFactionBankmenu', () => { - mp.gui.cursor.show(false, false); - factionBankmenu.Close(true); - globalData.InMenu = false; + if (globalData.InMenu && factionBankmenu) { + mp.gui.cursor.show(false, false); + factionBankmenu.Close(true); + globalData.InMenu = false; + } }); diff --git a/ReallifeGamemode.Server/Bank/bank.cs b/ReallifeGamemode.Server/Bank/bank.cs index 47d9aca4..1781103e 100644 --- a/ReallifeGamemode.Server/Bank/bank.cs +++ b/ReallifeGamemode.Server/Bank/bank.cs @@ -5,6 +5,7 @@ */ using GTANetworkAPI; using Newtonsoft.Json; +using ReallifeGamemode.Database.Entities; using ReallifeGamemode.Database.Models; using ReallifeGamemode.Server.Extensions; using ReallifeGamemode.Server.Finance; @@ -60,11 +61,14 @@ namespace ReallifeGamemode.Server.Bank { if (client.IsInVehicle || !client.IsLoggedIn() || client.GetUser().FactionId is null) return; - if (client.GetUser().FactionLeader == true) + User user = client.GetUser(); + + if (user.FactionLeader == true) { - client.TriggerEvent("showFactionBankMenuLeader", client.GetUser().Faction.BankAccount.Balance.ToString()); + client.TriggerEvent("showFactionBankMenuLeader", user.Faction.BankAccount.Balance.ToString()); + return; } - client.TriggerEvent("showFactionBankMenu", client.GetUser().Faction.BankAccount.Balance.ToString()); + client.TriggerEvent("showFactionBankMenu", user.Faction.BankAccount.Balance.ToString()); } private static void EntityExitFactionBankColShape(ColShape colShape, Player client) From a65824853ebea1c9cceab8a47137a3ee80d053cb Mon Sep 17 00:00:00 2001 From: hydrant Date: Sun, 11 Apr 2021 16:01:26 +0200 Subject: [PATCH 15/15] fix cardealer faction price anzeige --- ReallifeGamemode.Client/Business/cardealer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReallifeGamemode.Client/Business/cardealer.ts b/ReallifeGamemode.Client/Business/cardealer.ts index 96b5822c..b6667a31 100644 --- a/ReallifeGamemode.Client/Business/cardealer.ts +++ b/ReallifeGamemode.Client/Business/cardealer.ts @@ -72,7 +72,7 @@ export default function carDealer(globalData: IGlobalData) { priceItem.SetRightLabel("~g~$~s~ " + moneyFormat(price)); break; case 'Fraktion': - priceItem.SetRightLabel("~g~$~s~ " + moneyFormat(price * 3)); + priceItem.SetRightLabel("~g~$~s~ " + moneyFormat(price * 1.5)); break; } }