From 0678e19a7f7a48109669b9e207ddba1c36151e07 Mon Sep 17 00:00:00 2001 From: "michael.reiswich" Date: Tue, 26 Jan 2021 19:25:45 +0100 Subject: [PATCH 1/6] new weight for Weapons --- ReallifeGamemode.Server/Inventory/Items/CarbineRifle.cs | 2 +- ReallifeGamemode.Server/Inventory/Items/Combatpstiol.cs | 2 +- ReallifeGamemode.Server/WeaponDeal/WeaponDealManager.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ReallifeGamemode.Server/Inventory/Items/CarbineRifle.cs b/ReallifeGamemode.Server/Inventory/Items/CarbineRifle.cs index dbe3503f..b37f581b 100644 --- a/ReallifeGamemode.Server/Inventory/Items/CarbineRifle.cs +++ b/ReallifeGamemode.Server/Inventory/Items/CarbineRifle.cs @@ -11,7 +11,7 @@ namespace ReallifeGamemode.Server.Inventory.Items public override int Id => 6; public override string Name => "CarbineRifle"; public override string Description => "Waffe"; - public override int Gewicht => 4000; + public override int Gewicht => 500; public override string Einheit => "g"; public override uint Object => 3666746839; //3061944032 public override int Price => 0; diff --git a/ReallifeGamemode.Server/Inventory/Items/Combatpstiol.cs b/ReallifeGamemode.Server/Inventory/Items/Combatpstiol.cs index 3d04cdc5..f2034664 100644 --- a/ReallifeGamemode.Server/Inventory/Items/Combatpstiol.cs +++ b/ReallifeGamemode.Server/Inventory/Items/Combatpstiol.cs @@ -9,7 +9,7 @@ namespace ReallifeGamemode.Server.Inventory.Items public override int Id => 4; public override string Name => "Combatpistol"; public override string Description => "Waffe"; - public override int Gewicht => 1180; + public override int Gewicht => 500; public override string Einheit => "g"; public override uint Object => 3666746839; //3061944032 public override int Price => 0; diff --git a/ReallifeGamemode.Server/WeaponDeal/WeaponDealManager.cs b/ReallifeGamemode.Server/WeaponDeal/WeaponDealManager.cs index 737b70ad..0dc41119 100644 --- a/ReallifeGamemode.Server/WeaponDeal/WeaponDealManager.cs +++ b/ReallifeGamemode.Server/WeaponDeal/WeaponDealManager.cs @@ -13,7 +13,7 @@ namespace ReallifeGamemode.Server.WeaponDeal public class WeaponDealManager : Script { private const int WEAPON_AMOUNT_GANG = 2; - private const int WEAPON_AMOUNT_COP = 8; + private const int WEAPON_AMOUNT_COP = 5; private const int WEAPON_AMOUNT_COP_STUNGUN = 2; public static bool checkWeaponDbyVehicle(Vehicle vehicle) { From f693f3ac660093ea350886853f9a84a526bcff09 Mon Sep 17 00:00:00 2001 From: "michael.reiswich" Date: Wed, 27 Jan 2021 21:47:59 +0100 Subject: [PATCH 2/6] add real names of clothes and hair styles --- ReallifeGamemode.Client/Interaction/clothes/ClotheShop.ts | 8 ++++---- ReallifeGamemode.Client/Interaction/friseur/friseur.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ReallifeGamemode.Client/Interaction/clothes/ClotheShop.ts b/ReallifeGamemode.Client/Interaction/clothes/ClotheShop.ts index 3657c32e..f7c8088c 100644 --- a/ReallifeGamemode.Client/Interaction/clothes/ClotheShop.ts +++ b/ReallifeGamemode.Client/Interaction/clothes/ClotheShop.ts @@ -178,13 +178,13 @@ export default function clotheShopList(globalData: IGlobalData) { var txData = getClothingName(key, item.ClotheId, gender); for (const x of txData) { - //var itemDescription = (key === 11 ? mp.game.ui.getLabelText(x.undershirt[1].GXT) : "Clothing item."); - var itemDescription = (key === 11 ? x.undershirt[1].GXT + " - " + x.id: "Clothing item."); + var itemDescription = (key === 11 ? mp.game.ui.getLabelText(x.undershirt[1].GXT) : "Clothing item."); + //var itemDescription = (key === 11 ? x.undershirt[1].GXT + " - " + x.id: "Clothing item."); if (itemDescription == "NULL") { itemDescription = "Clothing item."; } - //const tempItem = new UIMenuItem(mp.game.ui.getLabelText(x.data[0].GXT), itemDescription); - const tempItem = new UIMenuItem(x.data[0].GXT + " - " + x.id , itemDescription); + const tempItem = new UIMenuItem(mp.game.ui.getLabelText(x.data[0].GXT), itemDescription); + //const tempItem = new UIMenuItem(x.data[0].GXT + " - " + x.id , itemDescription); tempItem.SetRightLabel(`${item.Price > 0 ? `$${item.Price}` : "FREE"}`); diff --git a/ReallifeGamemode.Client/Interaction/friseur/friseur.ts b/ReallifeGamemode.Client/Interaction/friseur/friseur.ts index 48331aea..ba64df88 100644 --- a/ReallifeGamemode.Client/Interaction/friseur/friseur.ts +++ b/ReallifeGamemode.Client/Interaction/friseur/friseur.ts @@ -116,8 +116,8 @@ export default function friseurShopList(globalData: IGlobalData) { if (itemDescription == "NULL") { itemDescription = "Clothing item."; } - //const tempItem = new UIMenuItem(mp.game.ui.getLabelText(x.data[0].GXT), itemDescription); - const tempItem = new UIMenuItem(x.data[0].GXT + " - " + x.id, itemDescription); + const tempItem = new UIMenuItem(mp.game.ui.getLabelText(x.data[0].GXT), itemDescription); + //const tempItem = new UIMenuItem(x.data[0].GXT + " - " + x.id, itemDescription); tempItem.SetRightLabel(`${item.Price > 0 ? `$${item.Price}` : "FREE"}`); From 4ef28ae9b20d78fa500d252c1dd614083cf22612 Mon Sep 17 00:00:00 2001 From: "michael.reiswich" Date: Wed, 27 Jan 2021 22:24:41 +0100 Subject: [PATCH 3/6] try fix friseur --- .../Interaction/friseur/friseur.ts | 2 +- .../Events/UpdateCharacterCloth.cs | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/ReallifeGamemode.Client/Interaction/friseur/friseur.ts b/ReallifeGamemode.Client/Interaction/friseur/friseur.ts index ba64df88..a6dd70a3 100644 --- a/ReallifeGamemode.Client/Interaction/friseur/friseur.ts +++ b/ReallifeGamemode.Client/Interaction/friseur/friseur.ts @@ -279,7 +279,7 @@ export default function friseurShopList(globalData: IGlobalData) { if (lastClothing.drawable == currentItem.ClotheId && lastClothing.texture == currentTexture) { mp.game.audio.playSoundFrontend(1, "Hack_Failed", "DLC_HEIST_BIOLAB_PREP_HACKING_SOUNDS", true); } else { - mp.events.callRemote("SERVER:BuyCharacterClothes", "clothe", JSON.stringify(serverData), currentItem.CloteID); + mp.events.callRemote("SERVER:BuyHair", "clothe", JSON.stringify(serverData), currentItem.CloteID); mp.events.call("friseurMenu:close"); } diff --git a/ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs b/ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs index 5b403165..c35787fe 100644 --- a/ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs +++ b/ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs @@ -278,6 +278,7 @@ namespace ReallifeGamemode.Server.Events undershirt.Texture = data[5]; } } + client.GetUser(dbContext).Handmoney -= data[6]; dbContext.SaveChanges(); //client.TriggerEvent("SERVER:SET_HANDMONEY", user.Handmoney); @@ -285,6 +286,43 @@ namespace ReallifeGamemode.Server.Events client.TriggerEvent("clothesMenu:updateLast", data[2], data[1], data[4], data[5], data[3]); } } + [RemoteEvent("SERVER:BuyHair")] + public void RmtEvent_BuyHair(Player client, string type, string jsonData, byte hair) + { + /* + * [0] ComponentID + * [1] TextureID + * [2] ClotheID + * [3] TorsoID + * [4] UndershirtID + * [5] UndershirtTextureID + * [6] Price + */ + + int[] data = JsonConvert.DeserializeObject(jsonData); + User user = client.GetUser(); + if (user.Handmoney < data[6]) + { + client.TriggerEvent("clothesMenu:Error"); + return; + } + + if (type == "clothe") + { + + client.SetClothes(data[0], data[2], data[1]); + + using (var dbContext = new DatabaseContext()) + { + User payer = client.GetUser(dbContext); + + client.GetUser(dbContext).Handmoney -= data[6]; + payer.Character.Hair = hair; + dbContext.SaveChanges(); + //client.TriggerEvent("SERVER:SET_HANDMONEY", user.Handmoney); + } + } + } [RemoteEvent("SERVER:BuyHairColor")] public void BuyHairColor(Player client, byte HairColor) From 87e601c2957333cec26a3ceddfb6bea3f2dccf71 Mon Sep 17 00:00:00 2001 From: "michael.reiswich" Date: Wed, 27 Jan 2021 22:30:12 +0100 Subject: [PATCH 4/6] jetzt aber --- ReallifeGamemode.Client/Interaction/friseur/friseur.ts | 2 +- ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ReallifeGamemode.Client/Interaction/friseur/friseur.ts b/ReallifeGamemode.Client/Interaction/friseur/friseur.ts index a6dd70a3..ba64df88 100644 --- a/ReallifeGamemode.Client/Interaction/friseur/friseur.ts +++ b/ReallifeGamemode.Client/Interaction/friseur/friseur.ts @@ -279,7 +279,7 @@ export default function friseurShopList(globalData: IGlobalData) { if (lastClothing.drawable == currentItem.ClotheId && lastClothing.texture == currentTexture) { mp.game.audio.playSoundFrontend(1, "Hack_Failed", "DLC_HEIST_BIOLAB_PREP_HACKING_SOUNDS", true); } else { - mp.events.callRemote("SERVER:BuyHair", "clothe", JSON.stringify(serverData), currentItem.CloteID); + mp.events.callRemote("SERVER:BuyCharacterClothes", "clothe", JSON.stringify(serverData), currentItem.CloteID); mp.events.call("friseurMenu:close"); } diff --git a/ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs b/ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs index c35787fe..13f85f6f 100644 --- a/ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs +++ b/ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs @@ -181,7 +181,7 @@ namespace ReallifeGamemode.Server.Events } [RemoteEvent("SERVER:BuyCharacterClothes")] - public void RmtEvent_BuyClothes(Player client, string type, string jsonData) + public void RmtEvent_BuyClothes(Player client, string type, string jsonData, byte hair) { /* * [0] ComponentID @@ -279,6 +279,12 @@ namespace ReallifeGamemode.Server.Events } } + if(data[0] == 2){ + User payer = client.GetUser(dbContext); + payer.Character.Hair = hair; + dbContext.SaveChanges(); + } + client.GetUser(dbContext).Handmoney -= data[6]; dbContext.SaveChanges(); //client.TriggerEvent("SERVER:SET_HANDMONEY", user.Handmoney); From 2b3bea6bdf6af81bfbbe882cb936e5124f5a9464 Mon Sep 17 00:00:00 2001 From: "michael.reiswich" Date: Wed, 27 Jan 2021 22:36:51 +0100 Subject: [PATCH 5/6] try fix --- .../Events/UpdateCharacterCloth.cs | 43 ++----------------- 1 file changed, 4 insertions(+), 39 deletions(-) diff --git a/ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs b/ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs index 13f85f6f..0e21146f 100644 --- a/ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs +++ b/ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs @@ -5,6 +5,7 @@ using Newtonsoft.Json; using ReallifeGamemode.Database.Entities; using ReallifeGamemode.Database.Models; using ReallifeGamemode.Server.Extensions; +using System; namespace ReallifeGamemode.Server.Events { @@ -181,7 +182,7 @@ namespace ReallifeGamemode.Server.Events } [RemoteEvent("SERVER:BuyCharacterClothes")] - public void RmtEvent_BuyClothes(Player client, string type, string jsonData, byte hair) + public void RmtEvent_BuyClothes(Player client, string type, string jsonData) { /* * [0] ComponentID @@ -281,7 +282,7 @@ namespace ReallifeGamemode.Server.Events if(data[0] == 2){ User payer = client.GetUser(dbContext); - payer.Character.Hair = hair; + payer.Character.Hair = Convert.ToByte(data[2]); dbContext.SaveChanges(); } @@ -292,43 +293,7 @@ namespace ReallifeGamemode.Server.Events client.TriggerEvent("clothesMenu:updateLast", data[2], data[1], data[4], data[5], data[3]); } } - [RemoteEvent("SERVER:BuyHair")] - public void RmtEvent_BuyHair(Player client, string type, string jsonData, byte hair) - { - /* - * [0] ComponentID - * [1] TextureID - * [2] ClotheID - * [3] TorsoID - * [4] UndershirtID - * [5] UndershirtTextureID - * [6] Price - */ - - int[] data = JsonConvert.DeserializeObject(jsonData); - User user = client.GetUser(); - if (user.Handmoney < data[6]) - { - client.TriggerEvent("clothesMenu:Error"); - return; - } - - if (type == "clothe") - { - - client.SetClothes(data[0], data[2], data[1]); - - using (var dbContext = new DatabaseContext()) - { - User payer = client.GetUser(dbContext); - - client.GetUser(dbContext).Handmoney -= data[6]; - payer.Character.Hair = hair; - dbContext.SaveChanges(); - //client.TriggerEvent("SERVER:SET_HANDMONEY", user.Handmoney); - } - } - } + [RemoteEvent("SERVER:BuyHairColor")] public void BuyHairColor(Player client, byte HairColor) From c122af964cef2fe8b77f2a15abc578588b58498e Mon Sep 17 00:00:00 2001 From: "michael.reiswich" Date: Wed, 27 Jan 2021 22:47:56 +0100 Subject: [PATCH 6/6] sollte jetzt klappen xddddd --- ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs b/ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs index 0e21146f..ea2d67d6 100644 --- a/ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs +++ b/ReallifeGamemode.Server/Events/UpdateCharacterCloth.cs @@ -282,6 +282,7 @@ namespace ReallifeGamemode.Server.Events if(data[0] == 2){ User payer = client.GetUser(dbContext); + payer.GetCharacter(dbContext); payer.Character.Hair = Convert.ToByte(data[2]); dbContext.SaveChanges(); }