diff --git a/ReallifeGamemode.Client/Interaction/interactionmenu.ts b/ReallifeGamemode.Client/Interaction/interactionmenu.ts index bcf29078..a3caeb76 100644 --- a/ReallifeGamemode.Client/Interaction/interactionmenu.ts +++ b/ReallifeGamemode.Client/Interaction/interactionmenu.ts @@ -181,12 +181,20 @@ export default function (globalData: GlobalData) { } licenseMenu.AddItem(menuItem); + menuItem = new UIMenuItem("Waffenschein"); + if (data.weaponLicense == false) { + menuItem.SetRightLabel("~r~nicht erhalten"); + } else if (data.weaponLicense == true) { + menuItem.SetRightLabel("~g~erhalten"); + } + licenseMenu.AddItem(menuItem); + licenseMenu.AddItem(new UIMenuItem("Lizenzen an Spieler zeigen")); licenseMenu.Visible = false; licenseMenu.ItemSelect.on((item, index) => { - if (index === 3) { + if (index === 4) { var input = new InputHelper("Welchen Spieler möchtest du deine Lizenzen zeigen (Name / ID)?", globalData); input.show(); input.getValue(name => { @@ -269,5 +277,5 @@ export default function (globalData: GlobalData) { return servicesMenu; } - + } diff --git a/ReallifeGamemode.Client/global.d.ts b/ReallifeGamemode.Client/global.d.ts index e50d8282..c4fa47e0 100644 --- a/ReallifeGamemode.Client/global.d.ts +++ b/ReallifeGamemode.Client/global.d.ts @@ -33,6 +33,7 @@ declare interface Licenses { drivingLicenseCar: boolean; drivingLicenseBike: boolean; flightLicensePlane: boolean; + weaponLicense: boolean; } declare interface FactionRanks { diff --git a/ReallifeGamemode.Server/DrivingSchool/Licenses.cs b/ReallifeGamemode.Server/DrivingSchool/Licenses.cs index 93745523..0e104bed 100644 --- a/ReallifeGamemode.Server/DrivingSchool/Licenses.cs +++ b/ReallifeGamemode.Server/DrivingSchool/Licenses.cs @@ -16,12 +16,16 @@ namespace ReallifeGamemode.Server.DrivingSchool [JsonProperty("flightLicensePlane")] public bool PlaneLicense { get; set; } + [JsonProperty("weaponLicense")] + public bool WeaponLicense { get; set; } - public Licenses(bool CarLicense, bool BikeLicense, bool PlaneLicense) + + public Licenses(bool CarLicense, bool BikeLicense, bool PlaneLicense, bool weaponLicense) { this.CarLicense = CarLicense; this.BikeLicense = BikeLicense; this.PlaneLicense = PlaneLicense; + this.WeaponLicense = weaponLicense; } } diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index 1a234e13..4a77e1f2 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -113,7 +113,7 @@ namespace ReallifeGamemode.Server.Events Paycheck paycheck = null; if (Economy.Paychecks.ContainsKey(u.Id)) paycheck = Economy.Paychecks[u.Id]; - Licenses licenses = new Licenses(u.DriverLicenseVehicle, u.DriverLicenseBike, u.FlyingLicensePlane); + Licenses licenses = new Licenses(u.DriverLicenseVehicle, u.DriverLicenseBike, u.FlyingLicensePlane, u.WeaponLicense); var accountData = new {