From a5059d2278df5a4ebda45d4b246c595366bdaf26 Mon Sep 17 00:00:00 2001 From: VegaZ Date: Sat, 17 Apr 2021 03:07:34 +0200 Subject: [PATCH] Move Waffenschein --- .../Gui/policedepartment.ts | 2 +- ReallifeGamemode.Database/sql | 43 +++++++++++++++++++ .../Menus/PoliceDepartment.cs | 4 +- 3 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 ReallifeGamemode.Database/sql diff --git a/ReallifeGamemode.Client/Gui/policedepartment.ts b/ReallifeGamemode.Client/Gui/policedepartment.ts index df378604..298af37a 100644 --- a/ReallifeGamemode.Client/Gui/policedepartment.ts +++ b/ReallifeGamemode.Client/Gui/policedepartment.ts @@ -24,7 +24,7 @@ menu.MenuClose.on(() => { game.events.add("SERVER:PoliceDepartment_EnterColShape", () => { //game.ui.setHelpText("Drücke ~INPUT_CONTEXT~, um das Menü des Polizeireviers zu öffnen"); - mp.events.call("renderHelpTextOnScreen", "~s~Drücke ~g~E~s~ um das Menü des ~b~Polizeireviers ~s~zu öffnen") + //mp.events.call("renderHelpTextOnScreen", "~s~Drücke ~g~E~s~ um das Menü des ~b~Polizeireviers ~s~zu öffnen") game.events.bindKey(Key.E, false, keyPressHandler); }); diff --git a/ReallifeGamemode.Database/sql b/ReallifeGamemode.Database/sql new file mode 100644 index 00000000..72d9528e --- /dev/null +++ b/ReallifeGamemode.Database/sql @@ -0,0 +1,43 @@ +CREATE TABLE `WeaponCategories` ( + `Id` int NOT NULL AUTO_INCREMENT, + `Category` longtext CHARACTER SET utf8mb4 NULL, + CONSTRAINT `PK_WeaponCategories` PRIMARY KEY (`Id`) +); + +CREATE TABLE `Weapons` ( + `Id` int NOT NULL AUTO_INCREMENT, + `WeaponModel` longtext CHARACTER SET utf8mb4 NULL, + `CategoryId` int NOT NULL, + `SlotID` int NOT NULL, + `Ammo` int NOT NULL, + `Price` float NOT NULL, + CONSTRAINT `PK_Weapons` PRIMARY KEY (`Id`), + CONSTRAINT `FK_Weapons_WeaponCategories_CategoryId` FOREIGN KEY (`CategoryId`) REFERENCES `WeaponCategories` (`Id`) ON DELETE CASCADE +); + +CREATE TABLE `UserWeapons` ( + `Id` int NOT NULL AUTO_INCREMENT, + `UserId` int NOT NULL, + `WeaponId` int NOT NULL, + `Ammo` int NOT NULL, + CONSTRAINT `PK_UserWeapons` PRIMARY KEY (`Id`), + CONSTRAINT `FK_UserWeapons_Users_UserId` FOREIGN KEY (`UserId`) REFERENCES `Users` (`Id`) ON DELETE CASCADE, + CONSTRAINT `FK_UserWeapons_Weapons_WeaponId` FOREIGN KEY (`WeaponId`) REFERENCES `Weapons` (`Id`) ON DELETE CASCADE +); + +CREATE INDEX `IX_UserWeapons_UserId` ON `UserWeapons` (`UserId`); + +CREATE INDEX `IX_UserWeapons_WeaponId` ON `UserWeapons` (`WeaponId`); + +CREATE INDEX `IX_Weapons_CategoryId` ON `Weapons` (`CategoryId`); + +INSERT INTO `__EFMigrationsHistory` (`MigrationId`, `ProductVersion`) +VALUES ('20210413201146_Ammunations', '3.1.3'); + +ALTER TABLE `Weapons` ADD `AmmunationActive` tinyint(1) NOT NULL DEFAULT FALSE; + +ALTER TABLE `Weapons` ADD `Legal` tinyint(1) NOT NULL DEFAULT FALSE; + +INSERT INTO `__EFMigrationsHistory` (`MigrationId`, `ProductVersion`) +VALUES ('20210416175726_Ammunations2', '3.1.3'); + diff --git a/ReallifeGamemode.Server.Core/Menus/PoliceDepartment.cs b/ReallifeGamemode.Server.Core/Menus/PoliceDepartment.cs index 65aa993f..f4e9c3ef 100644 --- a/ReallifeGamemode.Server.Core/Menus/PoliceDepartment.cs +++ b/ReallifeGamemode.Server.Core/Menus/PoliceDepartment.cs @@ -61,9 +61,9 @@ namespace ReallifeGamemode.Server.Core.Menus private void CreateVisuals() { - Position pos = new Position(440.869, -981.045, 30.689); + Position pos = new Position(12.7499, -1105.1168, 29.797); - Api.TextLabel.CreateTextLabel("Polizeirevier\n\nDrücke ~y~E~s~, um das Menü zu öffnen", pos, 20f, 1.3f, Font.ChaletLondon, Color.White); + Api.TextLabel.CreateTextLabel("Waffenschein kaufen\n\nDrücke ~y~E~s~, um das Menü zu öffnen", pos, 20f, 1.3f, Font.ChaletLondon, Color.White); Api.Marker.CreateMarker(MarkerType.VerticalCylinder, pos.Subtract(new Position(0, 0, 1.7)), new Position(), new Position(), 1f, Color.White); IColShape colShape = Api.ColShape.CreateSphere(pos, 2f);