diff --git a/ReallifeGamemode.Client/Interaction/ammunation/ammunation.ts b/ReallifeGamemode.Client/Interaction/ammunation/ammunation.ts index b3ae2927..295716c0 100644 --- a/ReallifeGamemode.Client/Interaction/ammunation/ammunation.ts +++ b/ReallifeGamemode.Client/Interaction/ammunation/ammunation.ts @@ -1,9 +1,9 @@ import * as NativeUI from '../../libs/NativeUI'; -const UIMenu = NativeUI.Menu; -const UIMenuItem = NativeUI.UIMenuItem; -const UIMenuListItem = NativeUI.UIMenuListItem; -const UIMenuCheckboxItem = NativeUI.UIMenuCheckboxItem; +const Menu = NativeUI.Menu; +const MenuItem = NativeUI.UIMenuItem; +const MenuListItem = NativeUI.UIMenuListItem; +const MenuCheckboxItem = NativeUI.UIMenuCheckboxItem; const BadgeStyle = NativeUI.BadgeStyle; const Point = NativeUI.Point; const ItemsCollection = NativeUI.ItemsCollection; @@ -11,11 +11,17 @@ const Color = NativeUI.Color; export default function ammunation(globalData: IGlobalData) { - mp.events.add("AmmunationShop:LoadNativeUI") + var screenRes = mp.game.graphics.getScreenResolution(0, 0); - mp.gui.chat.activate(false); - globalData.InMenu = true; + class Weapon { - factionInteractionMenu = new Menu("Fraktionsinteraktion", userFactionName, new Point(0, screenRes.y / 3), null, null); + } + mp.events.add("AmmunationShop:LoadNativeUI", (weapons: Weapon[]) => { + mp.gui.chat.activate(false); + globalData.InMenu = true; + + var ammunationMenu = new Menu("Ammunation", "", new Point(0, screenRes.y / 3), null, null); + + }); }; \ No newline at end of file diff --git a/ReallifeGamemode.Client/global.d.ts b/ReallifeGamemode.Client/global.d.ts index 2242dd17..9ab1540c 100644 --- a/ReallifeGamemode.Client/global.d.ts +++ b/ReallifeGamemode.Client/global.d.ts @@ -74,4 +74,12 @@ declare type FactionMember = { declare type FactionRank = { +} + +declare type Weapon = { + WeaponModel: string; + Category: string; + SlotID: number; + Ammo: number; + Price: number; } \ No newline at end of file diff --git a/ReallifeGamemode.Server/Managers/ShopManager.cs b/ReallifeGamemode.Server/Managers/ShopManager.cs index f21470fb..dd7e35d2 100644 --- a/ReallifeGamemode.Server/Managers/ShopManager.cs +++ b/ReallifeGamemode.Server/Managers/ShopManager.cs @@ -6,6 +6,7 @@ using ReallifeGamemode.Database.Models; using ReallifeGamemode.Server.Shop.Clothing; using ReallifeGamemode.Server.Shop.SevenEleven; using ReallifeGamemode.Server.Shop.Friseur; +using ReallifeGamemode.Server.Shop.Ammunation; namespace ReallifeGamemode.Server.Managers { @@ -14,7 +15,7 @@ namespace ReallifeGamemode.Server.Managers public static List clotheStores = new List(); public static List itemShops = new List(); public static List FriseurStores = new List(); - public static List Ammunations = new List(); + public static List Ammunations = new List(); public static void LoadClotheShops() { @@ -82,5 +83,20 @@ namespace ReallifeGamemode.Server.Managers } } + public static void LoadAmmunations() + { + using (var dbContext = new DatabaseContext()) + { + List ammunations = dbContext.Blips.ToList().FindAll(s => s.Name == "Ammunation"); + + foreach (var store in ammunations) + { + Vector3 pos = new Vector3(store.PositionX, store.PositionY, store.PositionZ); + Ammunation newShop = new Ammunation(pos); + Ammunations.Add(newShop); + } + NAPI.Util.ConsoleOutput($"Loading {ammunations.Count} Ammunations"); + } + } } } diff --git a/ReallifeGamemode.Server/Shop/Ammunation/Ammunation.cs b/ReallifeGamemode.Server/Shop/Ammunation/Ammunation.cs index 5e3dde48..e7252734 100644 --- a/ReallifeGamemode.Server/Shop/Ammunation/Ammunation.cs +++ b/ReallifeGamemode.Server/Shop/Ammunation/Ammunation.cs @@ -37,15 +37,15 @@ namespace ReallifeGamemode.Server.Shop.Ammunation return; } - //List melee = weaponList.ToList().FindAll(w => w.Category == "Pistol"); - List handguns = weaponList.ToList().FindAll(w => w.Category == "Handgun"); - //List smgs = weaponList.ToList().FindAll(w => w.Category == "SMG"); - //List shotguns = weaponList.ToList().FindAll(w => w.Category == "Shotgun"); - //List assaultrifles = weaponList.ToList().FindAll(w => w.Category == "AssaultRifle"); - //List lmgs = weaponList.ToList().FindAll(w => w.Category == "LMG"); - //List sniperrifles = weaponList.ToList().FindAll(w => w.Category == "SniperRifle"); - //List heavyweapons = weaponList.ToList().FindAll(w => w.Category == "HeavyWeapon"); - //List throwables = weaponList.ToList().FindAll(w => w.Category == "Throwables"); + //List melee = weaponList.ToList().FindAll(w => w.Category == "Nahkampfwaffen"); + List handguns = weaponList.ToList().FindAll(w => w.Category == "Pistolen"); + //List smgs = weaponList.ToList().FindAll(w => w.Category == "Maschinenpistolen"); + //List shotguns = weaponList.ToList().FindAll(w => w.Category == "Schrotflinten"); + //List assaultrifles = weaponList.ToList().FindAll(w => w.Category == "Sturmgewehre"); + //List lmgs = weaponList.ToList().FindAll(w => w.Category == "Leichte Maschinengewehre"); + //List sniperrifles = weaponList.ToList().FindAll(w => w.Category == "Scharfschützengewehre"); + //List heavyweapons = weaponList.ToList().FindAll(w => w.Category == "Schwere Waffen"); + //List throwables = weaponList.ToList().FindAll(w => w.Category == "Werfbare Waffen"); List shopWeapons = new List {