From 4079b4bd3c576c7ec53f88e0536d00a82180e33e Mon Sep 17 00:00:00 2001 From: VegaZ Date: Thu, 1 Apr 2021 22:43:03 +0200 Subject: [PATCH 01/25] =?UTF-8?q?*WhitelistStatus=20hinzugef=C3=BCgt=20*Se?= =?UTF-8?q?rvervariablen=20hinzugef=C3=BCgt:=20/setsvar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ReallifeGamemode.Client/index.ts | 1 + .../Entities/ServerVariable.cs | 18 + .../20210331203931_SVars.Designer.cs | 1882 +++++++++++++++++ .../Migrations/20210331203931_SVars.cs | 51 + .../DatabaseContextModelSnapshot.cs | 23 + .../Models/DatabaseContext.cs | 3 + .../Commands/AdminCommands.cs | 17 +- ReallifeGamemode.Server/Events/Connect.cs | 37 +- ReallifeGamemode.Server/Gangwar/Turf.cs | 4 +- ReallifeGamemode.Server/Main.cs | 2 + .../Managers/SVarManager.cs | 45 + 11 files changed, 2070 insertions(+), 13 deletions(-) create mode 100644 ReallifeGamemode.Database/Entities/ServerVariable.cs create mode 100644 ReallifeGamemode.Database/Migrations/20210331203931_SVars.Designer.cs create mode 100644 ReallifeGamemode.Database/Migrations/20210331203931_SVars.cs create mode 100644 ReallifeGamemode.Server/Managers/SVarManager.cs diff --git a/ReallifeGamemode.Client/index.ts b/ReallifeGamemode.Client/index.ts index 1ee4852f..9f152c37 100644 --- a/ReallifeGamemode.Client/index.ts +++ b/ReallifeGamemode.Client/index.ts @@ -57,6 +57,7 @@ cityHall(globalData); import adminSpeed from './admin/aspeed'; adminSpeed(); + import voice from './Voice/main'; voice(globalData); diff --git a/ReallifeGamemode.Database/Entities/ServerVariable.cs b/ReallifeGamemode.Database/Entities/ServerVariable.cs new file mode 100644 index 00000000..7d75fdf9 --- /dev/null +++ b/ReallifeGamemode.Database/Entities/ServerVariable.cs @@ -0,0 +1,18 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using GTANetworkAPI; + +namespace ReallifeGamemode.Database.Entities +{ + public partial class ServerVariable + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int Id { get; set; } + + public string Variable { get; set; } + + public int Value { get; set; } + } + +} diff --git a/ReallifeGamemode.Database/Migrations/20210331203931_SVars.Designer.cs b/ReallifeGamemode.Database/Migrations/20210331203931_SVars.Designer.cs new file mode 100644 index 00000000..bc72ab17 --- /dev/null +++ b/ReallifeGamemode.Database/Migrations/20210331203931_SVars.Designer.cs @@ -0,0 +1,1882 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using ReallifeGamemode.Database.Models; + +namespace ReallifeGamemode.Database.Migrations +{ + [DbContext(typeof(DatabaseContext))] + [Migration("20210331203931_SVars")] + partial class SVars + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.3") + .HasAnnotation("PropertyAccessMode", PropertyAccessMode.PreferFieldDuringConstruction) + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ATM", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Balance") + .HasColumnType("int"); + + b.Property("Faulty") + .HasColumnType("tinyint(1)"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.Property("Z") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.ToTable("ATMs"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Ban", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Applied") + .HasColumnType("int"); + + b.Property("BannedBy") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Reason") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("UntilDateTime") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Bans"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.BusRoute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("BusRoutes"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.BusRoutePoint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("BusRouteId") + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.Property("Z") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("BusRouteId"); + + b.ToTable("BusRoutesPoints"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.BusinessBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Balance") + .HasColumnType("int"); + + b.Property("BusinessId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("BusinessId") + .IsUnique(); + + b.ToTable("BusinessBankAccounts"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.BusinessData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("BusinessId") + .HasColumnType("int"); + + b.Property("Price") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("BusinessData"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Character", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Ageing") + .HasColumnType("tinyint unsigned"); + + b.Property("AgeingOpacity") + .HasColumnType("float"); + + b.Property("BeardColor") + .HasColumnType("tinyint unsigned"); + + b.Property("Blemishes") + .HasColumnType("tinyint unsigned"); + + b.Property("BlemishesOpacity") + .HasColumnType("float"); + + b.Property("Blush") + .HasColumnType("tinyint unsigned"); + + b.Property("BlushColor") + .HasColumnType("tinyint unsigned"); + + b.Property("BlushOpacity") + .HasColumnType("float"); + + b.Property("BrowDepth") + .HasColumnType("float"); + + b.Property("BrowHeight") + .HasColumnType("float"); + + b.Property("CheekDepth") + .HasColumnType("float"); + + b.Property("CheekboneHeight") + .HasColumnType("float"); + + b.Property("CheekboneWidth") + .HasColumnType("float"); + + b.Property("ChestHair") + .HasColumnType("tinyint unsigned"); + + b.Property("ChestHairColor") + .HasColumnType("tinyint unsigned"); + + b.Property("ChestHairOpacity") + .HasColumnType("float"); + + b.Property("ChinDepth") + .HasColumnType("float"); + + b.Property("ChinHeight") + .HasColumnType("float"); + + b.Property("ChinIndent") + .HasColumnType("float"); + + b.Property("ChinWidth") + .HasColumnType("float"); + + b.Property("Complexion") + .HasColumnType("tinyint unsigned"); + + b.Property("ComplexionOpacity") + .HasColumnType("float"); + + b.Property("EyeColor") + .HasColumnType("tinyint unsigned"); + + b.Property("EyeSize") + .HasColumnType("float"); + + b.Property("EyebrowColor") + .HasColumnType("tinyint unsigned"); + + b.Property("Eyebrows") + .HasColumnType("tinyint unsigned"); + + b.Property("EyebrowsOpacity") + .HasColumnType("float"); + + b.Property("FacialHair") + .HasColumnType("tinyint unsigned"); + + b.Property("FacialHairOpacity") + .HasColumnType("float"); + + b.Property("Father") + .HasColumnType("tinyint unsigned"); + + b.Property("Freckles") + .HasColumnType("tinyint unsigned"); + + b.Property("FrecklesOpacity") + .HasColumnType("float"); + + b.Property("Gender") + .HasColumnType("tinyint(1)"); + + b.Property("Hair") + .HasColumnType("tinyint unsigned"); + + b.Property("HairColor") + .HasColumnType("tinyint unsigned"); + + b.Property("HairHighlightColor") + .HasColumnType("tinyint unsigned"); + + b.Property("JawShape") + .HasColumnType("float"); + + b.Property("JawWidth") + .HasColumnType("float"); + + b.Property("LipThickness") + .HasColumnType("float"); + + b.Property("Lipstick") + .HasColumnType("tinyint unsigned"); + + b.Property("LipstickColor") + .HasColumnType("tinyint unsigned"); + + b.Property("LipstickOpacity") + .HasColumnType("float"); + + b.Property("Makeup") + .HasColumnType("tinyint unsigned"); + + b.Property("MakeupOpacity") + .HasColumnType("float"); + + b.Property("Mother") + .HasColumnType("tinyint unsigned"); + + b.Property("NeckWidth") + .HasColumnType("float"); + + b.Property("NoseBottomHeight") + .HasColumnType("float"); + + b.Property("NoseBridgeDepth") + .HasColumnType("float"); + + b.Property("NoseBroken") + .HasColumnType("float"); + + b.Property("NoseTipHeight") + .HasColumnType("float"); + + b.Property("NoseTipLength") + .HasColumnType("float"); + + b.Property("NoseWidth") + .HasColumnType("float"); + + b.Property("Similarity") + .HasColumnType("float"); + + b.Property("SkinSimilarity") + .HasColumnType("float"); + + b.Property("SunDamage") + .HasColumnType("tinyint unsigned"); + + b.Property("SunDamageOpacity") + .HasColumnType("float"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Characters"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.CharacterCloth", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ClothId") + .HasColumnType("int"); + + b.Property("Duty") + .HasColumnType("tinyint(1)"); + + b.Property("SlotId") + .HasColumnType("int"); + + b.Property("SlotType") + .HasColumnType("tinyint unsigned"); + + b.Property("Texture") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("CharacterClothes"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ClothCombination", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Gender") + .HasColumnType("tinyint(1)"); + + b.Property("Top") + .HasColumnType("int"); + + b.Property("Torso") + .HasColumnType("int"); + + b.Property("Undershirt") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("ClothCombinations"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Door", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Category") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("FactionId") + .HasColumnType("int"); + + b.Property("Locked") + .HasColumnType("tinyint(1)"); + + b.Property("Model") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Radius") + .HasColumnType("float"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.Property("Z") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("Doors"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.DutyCloth", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ClothId") + .HasColumnType("int"); + + b.Property("FactionId") + .HasColumnType("int"); + + b.Property("Gender") + .HasColumnType("tinyint(1)"); + + b.Property("SlotId") + .HasColumnType("int"); + + b.Property("SlotType") + .HasColumnType("tinyint unsigned"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("DutyClothes"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Faction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("BankAccountId") + .HasColumnType("int"); + + b.Property("GangOwned") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("StateOwned") + .HasColumnType("tinyint(1)"); + + b.Property("WeaponDealTime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("BankAccountId"); + + b.ToTable("Factions"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.FactionBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Balance") + .HasColumnType("int"); + + b.Property("Bic") + .HasColumnType("varchar(12) CHARACTER SET utf8mb4") + .HasMaxLength(12); + + b.Property("Iban") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.HasKey("Id"); + + b.ToTable("FactionBankAccounts"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.FactionRank", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("FactionId") + .HasColumnType("int"); + + b.Property("Order") + .HasColumnType("int"); + + b.Property("RankName") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("FactionRanks"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.FactionWeapon", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Ammount") + .HasColumnType("int"); + + b.Property("FactionId") + .HasColumnType("int"); + + b.Property("Rank") + .HasColumnType("int"); + + b.Property("SlotID") + .HasColumnType("int"); + + b.Property("WeaponModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("FactionWeapons"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.GotoPoint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Description") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.Property("Z") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.ToTable("GotoPoints"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Group", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("BankAccountId") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.HasIndex("BankAccountId"); + + b.ToTable("Groups"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.GroupBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Balance") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("GroupBankAccounts"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.House", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("BankAccountId") + .HasColumnType("int"); + + b.Property("CanRentIn") + .HasColumnType("tinyint(1)"); + + b.Property("LastRentSetTime") + .HasColumnType("datetime(6)"); + + b.Property("OwnerId") + .HasColumnType("int"); + + b.Property("Price") + .HasColumnType("int"); + + b.Property("RentalFee") + .HasColumnType("int"); + + b.Property("Type") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.Property("Z") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("BankAccountId"); + + b.HasIndex("OwnerId"); + + b.ToTable("Houses"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.HouseBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Balance") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("HouseBankAccounts"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.HouseRental", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("HouseId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("HouseId"); + + b.HasIndex("UserId"); + + b.ToTable("HouseRentals"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Interior", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("EnterPositionStr") + .HasColumnName("EnterPosition") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("ExitPositionStr") + .HasColumnName("ExitPosition") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("Interiors"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Location", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Description") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Heading") + .HasColumnType("double"); + + b.Property("X") + .HasColumnType("double"); + + b.Property("Y") + .HasColumnType("double"); + + b.Property("Z") + .HasColumnType("double"); + + b.HasKey("Id"); + + b.ToTable("Locations"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Logs.BankAccountTransactionHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Fee") + .HasColumnType("int"); + + b.Property("MoneySent") + .HasColumnType("int"); + + b.Property("NewReceiverBalance") + .HasColumnType("int"); + + b.Property("NewSenderBalance") + .HasColumnType("int"); + + b.Property("Origin") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("Receiver") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("ReceiverBalance") + .HasColumnType("int"); + + b.Property("Sender") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("SenderBalance") + .HasColumnType("int"); + + b.Property("Timestamp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.ToTable("BankAccountTransactionLogs"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Logs.Death", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("CauseOfDeath") + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); + + b.Property("KillerHeading") + .HasColumnType("float"); + + b.Property("KillerId") + .HasColumnType("int"); + + b.Property("KillerPositionX") + .HasColumnType("float"); + + b.Property("KillerPositionY") + .HasColumnType("float"); + + b.Property("KillerPositionZ") + .HasColumnType("float"); + + b.Property("Timestamp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("VictimHeading") + .HasColumnType("float"); + + b.Property("VictimId") + .HasColumnType("int"); + + b.Property("VictimPositionX") + .HasColumnType("float"); + + b.Property("VictimPositionY") + .HasColumnType("float"); + + b.Property("VictimPositionZ") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.HasIndex("KillerId"); + + b.HasIndex("VictimId"); + + b.ToTable("DeathLogs"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.News", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Caption") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Content") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Timestamp") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("News"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Saves.SavedBlip", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Alpha") + .HasColumnType("tinyint unsigned"); + + b.Property("Color") + .HasColumnType("tinyint unsigned"); + + b.Property("Dimension") + .HasColumnType("tinyint unsigned"); + + b.Property("DrawDistance") + .HasColumnType("float"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("PositionX") + .HasColumnType("float"); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("Rotation") + .HasColumnType("float"); + + b.Property("Scale") + .HasColumnType("float"); + + b.Property("ShortRange") + .HasColumnType("tinyint(1)"); + + b.Property("Sprite") + .HasColumnType("smallint"); + + b.HasKey("Id"); + + b.ToTable("Blips"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Saves.SavedMarker", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("ColorA") + .HasColumnType("tinyint unsigned"); + + b.Property("ColorB") + .HasColumnType("tinyint unsigned"); + + b.Property("ColorG") + .HasColumnType("tinyint unsigned"); + + b.Property("ColorR") + .HasColumnType("tinyint unsigned"); + + b.Property("Dimension") + .HasColumnType("tinyint unsigned"); + + b.Property("DirectionX") + .HasColumnType("float"); + + b.Property("DirectionY") + .HasColumnType("float"); + + b.Property("DirectionZ") + .HasColumnType("float"); + + b.Property("PositionX") + .HasColumnType("float"); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("RotationX") + .HasColumnType("float"); + + b.Property("RotationY") + .HasColumnType("float"); + + b.Property("RotationZ") + .HasColumnType("float"); + + b.Property("Scale") + .HasColumnType("float"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("Visible") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("Markers"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Saves.SavedPed", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Dimension") + .HasColumnType("tinyint unsigned"); + + b.Property("HashModel") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Heading") + .HasColumnType("float"); + + b.Property("PositionX") + .HasColumnType("float"); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Peds"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Saves.SavedPickup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Dimension") + .HasColumnType("tinyint unsigned"); + + b.Property("PositionX") + .HasColumnType("float") + .HasMaxLength(128); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("RespawnTime") + .HasColumnType("int"); + + b.Property("RotationX") + .HasColumnType("float"); + + b.Property("RotationY") + .HasColumnType("float"); + + b.Property("RotationZ") + .HasColumnType("float"); + + b.Property("Vehicle") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("Pickups"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Saves.SavedTextLabel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("ColorA") + .HasColumnType("tinyint unsigned"); + + b.Property("ColorB") + .HasColumnType("tinyint unsigned"); + + b.Property("ColorG") + .HasColumnType("tinyint unsigned"); + + b.Property("ColorR") + .HasColumnType("tinyint unsigned"); + + b.Property("Dimension") + .HasColumnType("tinyint unsigned"); + + b.Property("DrawDistance") + .HasColumnType("float"); + + b.Property("Font") + .HasColumnType("tinyint unsigned"); + + b.Property("LOS") + .HasColumnType("tinyint(1)"); + + b.Property("PositionX") + .HasColumnType("float"); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("Text") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("TextLabels"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ServerVariable", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.Property("Variable") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("ServerVariables"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ServerVehicle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("Discriminator") + .IsRequired() + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("DistanceDriven") + .HasColumnType("float"); + + b.Property("Heading") + .HasColumnType("float"); + + b.Property("Livery") + .HasColumnType("int"); + + b.Property("Locked") + .HasColumnType("tinyint(1)"); + + b.Property("Model") + .HasColumnType("int unsigned"); + + b.Property("NumberPlate") + .HasColumnType("varchar(8) CHARACTER SET utf8mb4") + .HasMaxLength(8); + + b.Property("PositionX") + .HasColumnType("float"); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("PrimaryColor") + .HasColumnType("int"); + + b.Property("SecondaryColor") + .HasColumnType("int"); + + b.Property("TankAmount") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.ToTable("ServerVehicles"); + + b.HasDiscriminator("Discriminator").HasValue("ServerVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ShopClothe", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Category") + .HasColumnType("int"); + + b.Property("ClotheId") + .HasColumnType("int"); + + b.Property("ComponentId") + .HasColumnType("int"); + + b.Property("Gender") + .HasColumnType("tinyint(1)"); + + b.Property("Price") + .HasColumnType("int"); + + b.Property("TypeId") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("ShopClothes"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ShopItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Amount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("int"); + + b.Property("Price") + .HasColumnType("int"); + + b.Property("ShopId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("ShopItems"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.TuningGarage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.Property("Z") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.ToTable("TuningGarages"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Turfs", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Color") + .HasColumnType("int"); + + b.Property("FactionId") + .HasColumnType("int"); + + b.Property("MaxValue") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Owner") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("Range") + .HasColumnType("float"); + + b.Property("Rotation") + .HasColumnType("float"); + + b.Property("Surplus") + .HasColumnType("tinyint(1)"); + + b.Property("Value") + .HasColumnType("int"); + + b.Property("Vector") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.Property("X") + .HasColumnType("float"); + + b.Property("Y") + .HasColumnType("float"); + + b.HasKey("Id"); + + b.ToTable("Turfs"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("AdminLevel") + .HasColumnType("int"); + + b.Property("BanId") + .HasColumnType("int"); + + b.Property("BankAccountId") + .HasColumnType("int"); + + b.Property("BusSkill") + .HasColumnType("int"); + + b.Property("BusinessId") + .HasColumnType("int"); + + b.Property("CharacterId") + .HasColumnType("int"); + + b.Property("Dead") + .HasColumnType("tinyint(1)"); + + b.Property("DriverLicenseBike") + .HasColumnType("tinyint(1)"); + + b.Property("DriverLicenseVehicle") + .HasColumnType("tinyint(1)"); + + b.Property("Email") + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); + + b.Property("FactionId") + .HasColumnType("int"); + + b.Property("FactionLeader") + .HasColumnType("tinyint(1)"); + + b.Property("FactionRankId") + .HasColumnType("int"); + + b.Property("FlyingLicensePlane") + .HasColumnType("tinyint(1)"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.Property("GroupRank") + .HasColumnType("int"); + + b.Property("Handmoney") + .HasColumnType("int"); + + b.Property("HouseId") + .HasColumnType("int"); + + b.Property("JailTime") + .HasColumnType("int"); + + b.Property("JobId") + .HasColumnType("int"); + + b.Property("LogUserId") + .HasColumnType("int"); + + b.Property("Name") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("Password") + .HasColumnType("varchar(64) CHARACTER SET utf8mb4") + .HasMaxLength(64); + + b.Property("PaydayTimer") + .HasColumnType("int"); + + b.Property("PilotSkill") + .HasColumnType("int"); + + b.Property("PlayedMinutes") + .HasColumnType("int"); + + b.Property("Points") + .HasColumnType("int"); + + b.Property("PositionX") + .HasColumnType("float"); + + b.Property("PositionY") + .HasColumnType("float"); + + b.Property("PositionZ") + .HasColumnType("float"); + + b.Property("RegistrationDate") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)"); + + b.Property("SocialClubName") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.Property("Wage") + .HasColumnType("int"); + + b.Property("Wanteds") + .HasColumnType("int"); + + b.Property("WeaponLicense") + .HasColumnType("tinyint(1)"); + + b.Property("failpoints") + .HasColumnType("int"); + + b.Property("otheramount") + .HasColumnType("int"); + + b.Property("trashcount") + .HasColumnType("int"); + + b.Property("warn") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("BanId"); + + b.HasIndex("BankAccountId"); + + b.HasIndex("BusinessId") + .IsUnique(); + + b.HasIndex("CharacterId"); + + b.HasIndex("FactionId"); + + b.HasIndex("FactionRankId"); + + b.HasIndex("GroupId"); + + b.HasIndex("HouseId"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Balance") + .HasColumnType("int"); + + b.Property("Bic") + .HasColumnType("varchar(12) CHARACTER SET utf8mb4") + .HasMaxLength(12); + + b.Property("Iban") + .HasColumnType("varchar(32) CHARACTER SET utf8mb4") + .HasMaxLength(32); + + b.HasKey("Id"); + + b.ToTable("UserBankAccounts"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Amount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("int"); + + b.Property("Slot") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserItems"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.VehicleItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Amount") + .HasColumnType("int"); + + b.Property("ItemId") + .HasColumnType("int"); + + b.Property("Slot") + .HasColumnType("int"); + + b.Property("VehicleId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("VehicleId"); + + b.ToTable("VehicleItems"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.VehicleMod", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ModId") + .HasColumnType("int"); + + b.Property("ServerVehicleId") + .HasColumnType("int"); + + b.Property("Slot") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ServerVehicleId", "Slot") + .IsUnique(); + + b.ToTable("VehicleMods"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Whitelist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("SocialClubName") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("WhitelistEntries"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.FactionVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.Property("BuyPrice") + .HasColumnType("int"); + + b.Property("Owners") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.ToTable("FactionVehicles"); + + b.HasDiscriminator().HasValue("FactionVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.GroupVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.Property("GroupId") + .HasColumnType("int"); + + b.HasIndex("GroupId"); + + b.HasDiscriminator().HasValue("GroupVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.JobVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.Property("JobId") + .HasColumnType("int"); + + b.HasDiscriminator().HasValue("JobVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.NoobSpawnVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.HasDiscriminator().HasValue("NoobSpawnVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.NoobVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.HasDiscriminator().HasValue("NoobVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Saves.SavedVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.HasDiscriminator().HasValue("SavedVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.SchoolVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.Property("SchoolId") + .HasColumnType("int"); + + b.HasDiscriminator().HasValue("SchoolVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ShopVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.Property("BusinessId") + .HasColumnType("int"); + + b.Property("Price") + .HasColumnType("int"); + + b.ToTable("ShopVehicles"); + + b.HasDiscriminator().HasValue("ShopVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserVehicle", b => + { + b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle"); + + b.Property("Price") + .HasColumnName("UserVehicle_Price") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("int"); + + b.HasIndex("UserId"); + + b.ToTable("UserVehicles"); + + b.HasDiscriminator().HasValue("UserVehicle"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Ban", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.BusRoutePoint", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.BusRoute", "BusRoute") + .WithMany("RoutePoints") + .HasForeignKey("BusRouteId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Character", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.CharacterCloth", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Door", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.DutyCloth", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Faction", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.FactionBankAccount", "BankAccount") + .WithMany() + .HasForeignKey("BankAccountId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.FactionRank", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.FactionWeapon", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Group", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.GroupBankAccount", "BankAccount") + .WithMany() + .HasForeignKey("BankAccountId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.House", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.HouseBankAccount", "BankAccount") + .WithMany() + .HasForeignKey("BankAccountId"); + + b.HasOne("ReallifeGamemode.Database.Entities.User", "Owner") + .WithMany() + .HasForeignKey("OwnerId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.HouseRental", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.House", "House") + .WithMany("Rentals") + .HasForeignKey("HouseId"); + + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.Logs.Death", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "Killer") + .WithMany() + .HasForeignKey("KillerId"); + + b.HasOne("ReallifeGamemode.Database.Entities.User", "Victim") + .WithMany() + .HasForeignKey("VictimId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.News", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.User", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.Ban", "Ban") + .WithMany() + .HasForeignKey("BanId"); + + b.HasOne("ReallifeGamemode.Database.Entities.UserBankAccount", "BankAccount") + .WithMany() + .HasForeignKey("BankAccountId"); + + b.HasOne("ReallifeGamemode.Database.Entities.Character", "Character") + .WithMany() + .HasForeignKey("CharacterId"); + + b.HasOne("ReallifeGamemode.Database.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId"); + + b.HasOne("ReallifeGamemode.Database.Entities.FactionRank", "FactionRank") + .WithMany() + .HasForeignKey("FactionRankId"); + + b.HasOne("ReallifeGamemode.Database.Entities.Group", "Group") + .WithMany() + .HasForeignKey("GroupId"); + + b.HasOne("ReallifeGamemode.Database.Entities.House", "House") + .WithMany() + .HasForeignKey("HouseId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserItem", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.VehicleItem", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.ServerVehicle", "Vehicle") + .WithMany() + .HasForeignKey("VehicleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.VehicleMod", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.ServerVehicle", "Vehicle") + .WithMany() + .HasForeignKey("ServerVehicleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.GroupVehicle", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.Group", "Group") + .WithMany() + .HasForeignKey("GroupId"); + }); + + modelBuilder.Entity("ReallifeGamemode.Database.Entities.UserVehicle", b => + { + b.HasOne("ReallifeGamemode.Database.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/ReallifeGamemode.Database/Migrations/20210331203931_SVars.cs b/ReallifeGamemode.Database/Migrations/20210331203931_SVars.cs new file mode 100644 index 00000000..b9ddf8cb --- /dev/null +++ b/ReallifeGamemode.Database/Migrations/20210331203931_SVars.cs @@ -0,0 +1,51 @@ +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace ReallifeGamemode.Database.Migrations +{ + public partial class SVars : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "failpoints", + table: "Users", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "warn", + table: "Users", + nullable: false, + defaultValue: 0); + + migrationBuilder.CreateTable( + name: "ServerVariables", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Variable = table.Column(nullable: true), + Value = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ServerVariables", x => x.Id); + }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "ServerVariables"); + + migrationBuilder.DropColumn( + name: "failpoints", + table: "Users"); + + migrationBuilder.DropColumn( + name: "warn", + table: "Users"); + } + } +} diff --git a/ReallifeGamemode.Database/Migrations/DatabaseContextModelSnapshot.cs b/ReallifeGamemode.Database/Migrations/DatabaseContextModelSnapshot.cs index 5cf1a6bf..b502af3e 100644 --- a/ReallifeGamemode.Database/Migrations/DatabaseContextModelSnapshot.cs +++ b/ReallifeGamemode.Database/Migrations/DatabaseContextModelSnapshot.cs @@ -1121,6 +1121,23 @@ namespace ReallifeGamemode.Database.Migrations b.ToTable("TextLabels"); }); + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ServerVariable", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("int"); + + b.Property("Variable") + .HasColumnType("longtext CHARACTER SET utf8mb4"); + + b.HasKey("Id"); + + b.ToTable("ServerVariables"); + }); + modelBuilder.Entity("ReallifeGamemode.Database.Entities.ServerVehicle", b => { b.Property("Id") @@ -1415,12 +1432,18 @@ namespace ReallifeGamemode.Database.Migrations b.Property("WeaponLicense") .HasColumnType("tinyint(1)"); + b.Property("failpoints") + .HasColumnType("int"); + b.Property("otheramount") .HasColumnType("int"); b.Property("trashcount") .HasColumnType("int"); + b.Property("warn") + .HasColumnType("int"); + b.HasKey("Id"); b.HasIndex("BanId"); diff --git a/ReallifeGamemode.Database/Models/DatabaseContext.cs b/ReallifeGamemode.Database/Models/DatabaseContext.cs index 0acb0bd3..af7eca89 100644 --- a/ReallifeGamemode.Database/Models/DatabaseContext.cs +++ b/ReallifeGamemode.Database/Models/DatabaseContext.cs @@ -152,6 +152,9 @@ namespace ReallifeGamemode.Database.Models //ItemShop public DbSet ShopItems { get; set; } + + //Server Variablen + public DbSet ServerVariables { get; set; } } public class DesignTimeDbContextFactory : IDesignTimeDbContextFactory diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 05bc5f0a..c8170a20 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -236,7 +236,7 @@ namespace ReallifeGamemode.Server.Commands case "ip": if(player.HasData("togip")) { - player.SetData("togip", false); + player.ResetData("togip"); player.SendNotification("~g~[Info]~w~ Ip´s werden nun ausgeblendet."); } else @@ -249,7 +249,7 @@ namespace ReallifeGamemode.Server.Commands case "deathlogs": if (player.HasData("togdeath")) { - player.SetData("togdeath", false); + player.ResetData("togdeath"); player.SendNotification("~g~[Info]~w~ Deathlogs werden nun ausgeblendet."); } else @@ -261,7 +261,7 @@ namespace ReallifeGamemode.Server.Commands case "lc": if (player.HasData("toglc")) { - player.SetData("toglc", false); + player.ResetData("toglc"); player.SendNotification("~g~[Info]~w~ Leaderchat wird nun ausgeblendet."); } else @@ -1727,6 +1727,17 @@ namespace ReallifeGamemode.Server.Commands #region ALevel1337 + [Command("setsvar", "~m~Benutzung:~s~ /setsvar [ID] [WERT]")] + public void CmdAdmSetSvar(Player player, int varId, int varValue) + { + if (!player.GetUser()?.IsAdmin(AdminLevel.PROJEKTLEITUNG) ?? true) + { + ChatService.NotAuthorized(player); + return; + } + Managers.SVarManager.ChangeSVarValue(player, varId, varValue); + } + [Command("createturf", "~m~Benutzung:~s~ /createturf [radius]")] public void CmdAdmCreateTurf(Player player, float option) { diff --git a/ReallifeGamemode.Server/Events/Connect.cs b/ReallifeGamemode.Server/Events/Connect.cs index 7a501a26..813aca62 100644 --- a/ReallifeGamemode.Server/Events/Connect.cs +++ b/ReallifeGamemode.Server/Events/Connect.cs @@ -2,6 +2,7 @@ using System.Linq; using GTANetworkAPI; using ReallifeGamemode.Database.Models; +using ReallifeGamemode.Server.Extensions; using ReallifeGamemode.Server.Managers; using ReallifeGamemode.Server.Services; using ReallifeGamemode.Server.Types; @@ -29,21 +30,39 @@ namespace ReallifeGamemode.Server.Events bool registered = false; + var whitelistStatus = Managers.SVarManager.SVars.FirstOrDefault(v => v.Variable == "WhitelistStatus").Value; + using (var dbContext = new DatabaseContext()) { registered = dbContext.Users.Where(u => u.Name == player.Name).Any(); - - if (!dbContext.WhitelistEntries.Any(w => w.SocialClubName == player.SocialClubName)) + switch (whitelistStatus) { - string msg2 = "~m~*** " + player.Name + "[" + player.SocialClubName + "] (" + player.Address + ") hat versucht, sich einzuloggen, steht aber nicht auf der Whitelist."; - ChatService.BroadcastAdmin(msg2, AdminLevel.ADMIN); + case 0: //Whitelist aus + break; - NAPI.Util.ConsoleOutput(player.Name + " tried to join without whitelist entry"); + case 1: //Whitelist aktiv (Main-Server) + if (dbContext.Users.FirstOrDefault(u => u.SocialClubName == player.SocialClubName).AdminLevel < AdminLevel.MAPPING) + { + NAPI.Util.ConsoleOutput(player.Name + " versucht sich einzuloggen während die Whitelist an ist. [STATUS 1]"); + player.Kick(); + return; + } + break; - ChatService.SendMessage(player, "~m~Du stehst nicht auf der Whitelist"); + case 2: //Whitelist aktiv (Test-Server) + if (!dbContext.WhitelistEntries.Any(w => w.SocialClubName == player.SocialClubName)) + { + string msg2 = "~m~*** " + player.Name + "[" + player.SocialClubName + "] (" + player.Address + ") hat versucht, sich einzuloggen, steht aber nicht auf der Whitelist."; + ChatService.BroadcastAdmin(msg2, AdminLevel.ADMIN); - player.Kick(); - return; + NAPI.Util.ConsoleOutput(player.Name + " tried to join without whitelist entry [STATUS 2]"); + + ChatService.SendMessage(player, "~m~Du stehst nicht auf der Whitelist"); + + player.Kick(); + return; + } + break; } } @@ -64,7 +83,7 @@ namespace ReallifeGamemode.Server.Events string msg = "~m~*** " + player.Name + " [" + player.SocialClubName + "] [ID: " + player.Handle.Value + "] (" + player.Address + ")"; if(player.HasData("togip")) { - ChatService.SendMessage(player, msg); + ChatService.SendMessage(player, msg); } } diff --git a/ReallifeGamemode.Server/Gangwar/Turf.cs b/ReallifeGamemode.Server/Gangwar/Turf.cs index 2d9463a2..bf6dd5cc 100644 --- a/ReallifeGamemode.Server/Gangwar/Turf.cs +++ b/ReallifeGamemode.Server/Gangwar/Turf.cs @@ -268,6 +268,7 @@ namespace ReallifeGamemode.Server.Gangwar } ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion hat erfolgreich das Gebiet ~g~" + getName() + "~w~ verteidigt.", dbContext.Factions.Where(f => f.Name == getOwner()).FirstOrDefault()); ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion hat den Angrif auf das Gebiet ~r~" + getName() + "~w~ verloren.", dbContext.Factions.Where(f => f.Name == getAttacker()).FirstOrDefault()); + dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Name == getOwner()).First().BankAccount.Balance += 15000; } else if (getOwner() != FactionName) { @@ -284,9 +285,10 @@ namespace ReallifeGamemode.Server.Gangwar } this.Owner = FactionName; ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion konnte erfolgreich das Gebiet ~g~" + getName() + "~w~ erobern.", dbContext.Factions.Where(f => f.Name == getOwner()).FirstOrDefault()); + dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Name == getOwner()).First().BankAccount.Balance += 10000; Turfs turf = dbContext.Turfs.Where(t => t.Id == getId()).FirstOrDefault(); turf.Owner = this.Owner; - turf.FactionId = dbContext.Factions.Where(f => f.Name == this.Owner).FirstOrDefault().Id; + turf.FactionId = dbContext.Factions.Where(f => f.Name == this.Owner).FirstOrDefault().Id; dbContext.SaveChanges(); } } diff --git a/ReallifeGamemode.Server/Main.cs b/ReallifeGamemode.Server/Main.cs index e012348c..f21fe826 100644 --- a/ReallifeGamemode.Server/Main.cs +++ b/ReallifeGamemode.Server/Main.cs @@ -153,6 +153,8 @@ namespace ReallifeGamemode.Server ThreadTimers.StartAllTimers(); + Managers.SVarManager.LoadSVars(); + UserBankAccount.BalanceChanged += (account) => { using (var dbContext = new DatabaseContext()) diff --git a/ReallifeGamemode.Server/Managers/SVarManager.cs b/ReallifeGamemode.Server/Managers/SVarManager.cs new file mode 100644 index 00000000..81eeaffd --- /dev/null +++ b/ReallifeGamemode.Server/Managers/SVarManager.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Linq; +using GTANetworkAPI; +using ReallifeGamemode.Database.Entities; +using ReallifeGamemode.Database.Models; +using ReallifeGamemode.Server.Services; + +namespace ReallifeGamemode.Server.Managers +{ + + public class SVarManager : Script + { + public static List SVars = new List(); + + public static void LoadSVars() + { + using (var dbContext = new DatabaseContext()) + { + SVars = dbContext.ServerVariables.Select(row => row).ToList(); + foreach(var svar in SVars) + { + System.Console.WriteLine("[SVAR][" + svar.Id + "] " + svar.Variable + " = " + svar.Value); + } + System.Console.WriteLine("Geladene Server Variablen [" + SVars.Count() + "]"); + } + } + + public static void ChangeSVarValue(Player player, int varId, int varValue) + { + using (var dbContext = new DatabaseContext()) + { + var changeValue = dbContext.ServerVariables.FirstOrDefault(v => v.Id == varId); + var oldValue = changeValue.Value; + SVars.FirstOrDefault(v => v.Id == varId).Value = varValue; + changeValue.Value = varValue; + dbContext.SaveChanges(); + + ChatService.SendMessage(player, "~r~Wert von Server Variable ~o~" + changeValue.Variable + "~r~ in ~g~ " + varValue + "~r~geändert. Alter Wert: ~y~" + oldValue); + + } + } + } +} From 04e4e9dc8603d5477bd74ce07252580b4f7accf7 Mon Sep 17 00:00:00 2001 From: VegaZ Date: Fri, 2 Apr 2021 15:38:46 +0200 Subject: [PATCH 02/25] =?UTF-8?q?*Fix=20M=C3=BCllmann=20/=20*Load=20Casino?= =?UTF-8?q?=20IPL=20/=20*Fix=20GangwarTakeover?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ReallifeGamemode.Client/util/Gangwar.ts | 2 +- ReallifeGamemode.Server/Events/Key.cs | 49 +++++----- .../Job/RefuseCollectorJob.cs | 94 ++++++++++--------- ReallifeGamemode.Server/Main.cs | 3 + 4 files changed, 75 insertions(+), 73 deletions(-) diff --git a/ReallifeGamemode.Client/util/Gangwar.ts b/ReallifeGamemode.Client/util/Gangwar.ts index ba7bd552..efb498fc 100644 --- a/ReallifeGamemode.Client/util/Gangwar.ts +++ b/ReallifeGamemode.Client/util/Gangwar.ts @@ -263,7 +263,7 @@ self.attacker = null; //self.blip.setFlashes(false); mp.game.invoke(Natives.SET_BLIP_FLASHES, self.blip, false); - self.blip.destroy(); + //self.blip.destroy(); self.setColor(self.owner); self.blip.setColour(self.color); mp.game.invoke(Natives.SET_BLIP_COLOUR, self.blip, self.color); diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index 97c73d91..ed77f397 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -546,8 +546,7 @@ namespace ReallifeGamemode.Server.Events player.TriggerEvent("renderTextOnScreen", "Steige nun in eines der Fahrzeuge und starte den Motor mit der Taste 'N'."); return; } - }else - { + } else { player.SendNotification("~r~[Fehler] ~w~ Du hast diesen Job nicht angenommen."); return; } @@ -569,40 +568,38 @@ namespace ReallifeGamemode.Server.Events player.TriggerEvent("renderTextOnScreen", "Steige nun in eines der Flugzeuge und starte den Motor mit der Taste 'N'."); return; } - }else - { - player.SendNotification("~r~[Fehler] ~w~ Du hast diesen Job nicht angenommen."); - return; - } - - if (nearestJobPoint.Skill >= 300 && player.GetUser().PilotSkill >= 300) - { - if (job.GetUsersInJob().Contains(player)) - { - player.SetData("PilotenBase", 2); - jobb.StopJob(player); - return; - } - if (!job.GetUsersInJob().Contains(player)) - { - player.SetData("PilotenBase", 2); - jobb.StartJobEvent(player); - player.TriggerEvent("renderTextOnScreen", "Steige nun in eines der Flugzeuge und starte den Motor mit der Taste 'N'."); - return; - } } else { - player.SendChatMessage("~y~[JOB] ~r~Dein Skilllevel ist noch zu niedrig."); + player.SendNotification("~r~[Fehler] ~w~ Du hast diesen Job nicht angenommen."); return; } - }else + + if (nearestJobPoint.Skill >= 300 && player.GetUser().PilotSkill >= 300) { - player.SendNotification("~r~[Fehler] ~w~ Du hast diesen Job nicht angenommen."); + if (job.GetUsersInJob().Contains(player)) + { + player.SetData("PilotenBase", 2); + jobb.StopJob(player); + return; + } + if (!job.GetUsersInJob().Contains(player)) + { + player.SetData("PilotenBase", 2); + jobb.StartJobEvent(player); + player.TriggerEvent("renderTextOnScreen", "Steige nun in eines der Flugzeuge und starte den Motor mit der Taste 'N'."); + return; + } + } else { + player.SendChatMessage("~y~[JOB] ~r~Dein Skilllevel ist noch zu niedrig."); return; } + } else { + player.SendNotification("~r~[Fehler] ~w~ Du hast diesen Job nicht angenommen."); + return; } } + } [RemoteEvent("keyPress:I")] public void KeyPressI(Player player) diff --git a/ReallifeGamemode.Server/Job/RefuseCollectorJob.cs b/ReallifeGamemode.Server/Job/RefuseCollectorJob.cs index 10e3e038..8fab42e2 100644 --- a/ReallifeGamemode.Server/Job/RefuseCollectorJob.cs +++ b/ReallifeGamemode.Server/Job/RefuseCollectorJob.cs @@ -220,18 +220,18 @@ namespace ReallifeGamemode.Server.Job { return; } - - foreach (var data in muellmanData) + using (var dbContext = new DatabaseContext()) { - if (data.getDataFromClient(player) == null) continue; - Player target = data.getPartnerClient(player); - User user1 = player.GetUser(); - User user2 = target.GetUser(); - using (var dbContext = new DatabaseContext()) + foreach (var data in muellmanData) { - user1 = player.GetUser(dbContext); - user2 = target.GetUser(dbContext); - user1.trashcount += 1; + if (data.getDataFromClient(player) == null) continue; + Player target = data.getPartnerClient(player); + User user1 = player.GetUser(dbContext); + User user2 = target.GetUser(dbContext); + + //user1 = player.GetUser(dbContext); + //user2 = target.GetUser(dbContext); + /*user1.trashcount += 1; if (user1.trashcount == 20) { @@ -249,11 +249,12 @@ namespace ReallifeGamemode.Server.Job target.SendChatMessage("~y~Dies ist dein 20ter Müllsack."); } } + dbContext.SaveChanges(); - } - player.AddAttachment("binbag", true); - if (target != null) - if (player.GetUser().trashcount >= 20) + player.AddAttachment("binbag", true); + */ + + if (player.GetUser(dbContext).trashcount >= 20) { ChatService.SendMessage((Player)player, "~y~Job: ~s~Der Müllwagen ist voll. Fahre nun zurück zur Recyclinganlage!"); if (target != null) @@ -265,23 +266,20 @@ namespace ReallifeGamemode.Server.Job } else { - using (var dbContext = new DatabaseContext()) + //user1 = player.GetUser(dbContext); + //user2 = target.GetUser(dbContext); + user1.trashcount += 1; + player.SendNotification("Müllsack: " + user1.trashcount + " von 20."); + if (target != null) { - user1 = player.GetUser(dbContext); - user2 = target.GetUser(dbContext); - user1.trashcount += 1; - player.SendNotification("Müllsack: " + user1.trashcount + " von 20."); - if (target != null) - { - target.SendNotification("Müllsack: " + user2.trashcount + " von 20."); - user2.trashcount += 1; - } - dbContext.SaveChanges(); + target.SendNotification("Müllsack: " + user2.trashcount + " von 20."); + user2.trashcount += 1; } + dbContext.SaveChanges(); } - player.AddAttachment("binbag", true); - if (target != null) - if (player.GetUser().trashcount >= 20) + player.AddAttachment("binbag", true); + + if (player.GetUser(dbContext).trashcount >= 20) { ChatService.SendMessage((Player)player, "~y~Job: ~s~Der Müllwagen ist voll. Fahre nun zurück zur Recyclinganlage!"); if (target != null) @@ -293,17 +291,22 @@ namespace ReallifeGamemode.Server.Job } else { + //user1 = player.GetUser(dbContext); + //user2 = target.GetUser(dbContext); + if (target != null) { - player.GetUser().Wage += 10; - target.GetUser().Wage += 10; + user1.Wage += 10; + user2.Wage += 10; } else { - player.GetUser().Wage += 20; + user1.Wage += 20; } + dbContext.SaveChanges(); } + } return; } } @@ -321,25 +324,24 @@ namespace ReallifeGamemode.Server.Job if (target != null) ChatService.SendMessage((Player)target, $"~y~Job: ~s~Fahrzeug wurde entleert. Säcke: {target.GetUser().trashcount}"); ChatService.SendMessage((Player)player, $"~y~Job: ~s~Fahrzeug wurde entleert. Säcke: {player.GetUser().trashcount}"); //bonus pro sack - if (target != null) - { - player.GetUser().Wage += 100; - target.GetUser().Wage += 100; - } - else - { - player.GetUser().Wage += 200; - } - User user1 = player.GetUser(); - User user2 = target.GetUser(); using (var dbContext = new DatabaseContext()) { - user1 = player.GetUser(dbContext); - user2 = target.GetUser(dbContext); + User user1 = player.GetUser(dbContext); + User user2 = target.GetUser(dbContext); - user1.trashcount -= user1.trashcount; if (target != null) - user2.trashcount -= user2.trashcount; + { + user1.Wage += 100; + user2.Wage += 100; + } + else + { + user1.Wage += 200; + } + + user1.trashcount -= user1.trashcount; + if (target != null) user2.trashcount -= user2.trashcount; + dbContext.SaveChanges(); } Console.WriteLine($"[DATA DEBUG] vehicle: {data.vehicle.DisplayName} | Players: {data.getClientsFromData().Count} | Säcke: {data.getTrashCount()}"); diff --git a/ReallifeGamemode.Server/Main.cs b/ReallifeGamemode.Server/Main.cs index f21fe826..dcb7cfe2 100644 --- a/ReallifeGamemode.Server/Main.cs +++ b/ReallifeGamemode.Server/Main.cs @@ -169,6 +169,9 @@ namespace ReallifeGamemode.Server { user.Player.TriggerEvent("SERVER:SET_HANDMONEY", user.Handmoney); }; + + //IPLS + NAPI.World.RequestIpl("vw_casino_garage"); } [RemoteEvent("CLIENT:Event")] From 2cb74a3da98828b00ede8ab5d05844917dd463db Mon Sep 17 00:00:00 2001 From: VegaZ Date: Fri, 2 Apr 2021 16:34:03 +0200 Subject: [PATCH 03/25] Fix Pilot-Job, Fix GangWar --- ReallifeGamemode.Client/util/Gangwar.ts | 2 +- ReallifeGamemode.Server/Events/Key.cs | 54 ++++++++++++------------- ReallifeGamemode.Server/Main.cs | 2 +- 3 files changed, 28 insertions(+), 30 deletions(-) diff --git a/ReallifeGamemode.Client/util/Gangwar.ts b/ReallifeGamemode.Client/util/Gangwar.ts index efb498fc..d0d49ff2 100644 --- a/ReallifeGamemode.Client/util/Gangwar.ts +++ b/ReallifeGamemode.Client/util/Gangwar.ts @@ -265,7 +265,7 @@ mp.game.invoke(Natives.SET_BLIP_FLASHES, self.blip, false); //self.blip.destroy(); self.setColor(self.owner); - self.blip.setColour(self.color); + //self.blip.setColour(self.color); mp.game.invoke(Natives.SET_BLIP_COLOUR, self.blip, self.color); self.setLeaderColShape(); return; diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index ed77f397..25f6ce51 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -546,12 +546,7 @@ namespace ReallifeGamemode.Server.Events player.TriggerEvent("renderTextOnScreen", "Steige nun in eines der Fahrzeuge und starte den Motor mit der Taste 'N'."); return; } - } else { - player.SendNotification("~r~[Fehler] ~w~ Du hast diesen Job nicht angenommen."); - return; - } - - if (nearestJobPoint.jobId == 3 && player.GetUser().JobId == 3) + } else if (nearestJobPoint.jobId == 3 && player.GetUser().JobId == 3) { if (nearestJobPoint.Skill < 300 && player.GetUser().PilotSkill >= 0) { @@ -571,35 +566,38 @@ namespace ReallifeGamemode.Server.Events } else { - player.SendNotification("~r~[Fehler] ~w~ Du hast diesen Job nicht angenommen."); + player.SendChatMessage("~y~[JOB] ~r~Dein Skilllevel ist noch zu niedrig."); return; } - - if (nearestJobPoint.Skill >= 300 && player.GetUser().PilotSkill >= 300) + if (nearestJobPoint.Skill >= 300 && player.GetUser().PilotSkill >= 300) + { + if (job.GetUsersInJob().Contains(player)) + { + player.SetData("PilotenBase", 2); + jobb.StopJob(player); + return; + } + if (!job.GetUsersInJob().Contains(player)) + { + player.SetData("PilotenBase", 2); + jobb.StartJobEvent(player); + player.TriggerEvent("renderTextOnScreen", "Steige nun in eines der Flugzeuge und starte den Motor mit der Taste 'N'."); + return; + } + } + else + { + player.SendChatMessage("~y~[JOB] ~r~Dein Skilllevel ist noch zu niedrig."); + return; + } + } + else { - if (job.GetUsersInJob().Contains(player)) - { - player.SetData("PilotenBase", 2); - jobb.StopJob(player); - return; - } - if (!job.GetUsersInJob().Contains(player)) - { - player.SetData("PilotenBase", 2); - jobb.StartJobEvent(player); - player.TriggerEvent("renderTextOnScreen", "Steige nun in eines der Flugzeuge und starte den Motor mit der Taste 'N'."); - return; - } - } else { - player.SendChatMessage("~y~[JOB] ~r~Dein Skilllevel ist noch zu niedrig."); + player.SendNotification("~r~[Fehler] ~w~ Du hast diesen Job nicht angenommen."); return; } - } else { - player.SendNotification("~r~[Fehler] ~w~ Du hast diesen Job nicht angenommen."); - return; } } - } [RemoteEvent("keyPress:I")] public void KeyPressI(Player player) diff --git a/ReallifeGamemode.Server/Main.cs b/ReallifeGamemode.Server/Main.cs index dcb7cfe2..c77b5c36 100644 --- a/ReallifeGamemode.Server/Main.cs +++ b/ReallifeGamemode.Server/Main.cs @@ -164,7 +164,7 @@ namespace ReallifeGamemode.Server PlayerService.GetPlayerByNameOrId(user).TriggerEvent("updateMoney", account.Balance); } }; - + User.HandMoneyChanged += (user) => { user.Player.TriggerEvent("SERVER:SET_HANDMONEY", user.Handmoney); From 0d8f76df3e0dd2b0bfa8462e59b6524ff0c1c1b4 Mon Sep 17 00:00:00 2001 From: "michael.reiswich" Date: Fri, 2 Apr 2021 16:47:49 +0200 Subject: [PATCH 04/25] add fahrschule --- ReallifeGamemode.Client/Gui/ahelp.ts | 2 -- ReallifeGamemode.Client/dlcpacks/Fahrstuhl/dlc.rpf | 3 +++ ReallifeGamemode.Client/index.ts | 6 ++++-- ReallifeGamemode.Server/Commands/AdminCommands.cs | 2 +- ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs | 4 ++-- 5 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 ReallifeGamemode.Client/dlcpacks/Fahrstuhl/dlc.rpf diff --git a/ReallifeGamemode.Client/Gui/ahelp.ts b/ReallifeGamemode.Client/Gui/ahelp.ts index 81d6720f..22025441 100644 --- a/ReallifeGamemode.Client/Gui/ahelp.ts +++ b/ReallifeGamemode.Client/Gui/ahelp.ts @@ -22,7 +22,6 @@ export default function ahelp(globalData: IGlobalData): void { ahelpBrowser = mp.browsers.new('package://assets/html/helpcommand/ahelp.html'); mp.gui.chat.activate(false); mp.gui.cursor.show(true, true); - } }); @@ -37,7 +36,6 @@ export default function ahelp(globalData: IGlobalData): void { globalData.InInput = false; mp.gui.cursor.show(false, false); mp.gui.chat.activate(true); - } }); diff --git a/ReallifeGamemode.Client/dlcpacks/Fahrstuhl/dlc.rpf b/ReallifeGamemode.Client/dlcpacks/Fahrstuhl/dlc.rpf new file mode 100644 index 00000000..ea2643a3 --- /dev/null +++ b/ReallifeGamemode.Client/dlcpacks/Fahrstuhl/dlc.rpf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f1478ada7534b954caaec991bb2a3a24767b978de82533965e0c21c3d02831f +size 8491 diff --git a/ReallifeGamemode.Client/index.ts b/ReallifeGamemode.Client/index.ts index 1ee4852f..6dfdafee 100644 --- a/ReallifeGamemode.Client/index.ts +++ b/ReallifeGamemode.Client/index.ts @@ -233,12 +233,14 @@ import bankMenuHandle from './Interaction/bankmenu'; import InputHelper from './inputhelper'; bankMenuHandle(globalData); -import Introduction from './Gui/introduction'; -Introduction(globalData); import ahelp from './Gui/ahelp'; ahelp(globalData); +import Introduction from './Gui/introduction'; +Introduction(globalData); + + import userhelp from './Gui/userhelp'; userhelp(globalData); diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 5e9fdb60..38e6b022 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -222,7 +222,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~]", GreedyArg = true)] public void CmdTog(Player player, string typ, string option1 = null, string option2 = null) { if (!player.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true) diff --git a/ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs b/ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs index a3c4a794..d88b8ce9 100644 --- a/ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs +++ b/ReallifeGamemode.Server/DrivingSchool/DrivingSchool.cs @@ -190,7 +190,7 @@ namespace ReallifeGamemode.Server.DrivingSchool veh.Position = sVeh.Position; veh.Rotation = new Vector3(0, 0, sVeh.Heading); - user.Position = new Vector3(-813.17, -1354.5, 4.14); + user.Position = new Vector3(-814.39, -1336.76, 5.15); } [RemoteEvent("drivingSchoolEvent")] @@ -304,7 +304,7 @@ namespace ReallifeGamemode.Server.DrivingSchool veh.Position = sVeh.Position; veh.Rotation = new Vector3(0, 0, sVeh.Heading); - user.Position = new Vector3(-813.17, -1354.5, 4.14); + user.Position = new Vector3(-814.39, -1336.76, 5.15); } [RemoteEvent("bikeSchoolEvent")] From e6112394af4678e497f49b1ee738a39bdb3f35cb Mon Sep 17 00:00:00 2001 From: VegaZ Date: Fri, 2 Apr 2021 16:54:07 +0200 Subject: [PATCH 05/25] Fix onlineList --- ReallifeGamemode.Server/Events/Key.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index 25f6ce51..e1631956 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -612,13 +612,22 @@ namespace ReallifeGamemode.Server.Events { if (!player.IsLoggedIn()) return; List players = NAPI.Pools.GetAllPlayers(); + + foreach(var lPlayer in players) + { + if(!lPlayer.IsLoggedIn()) + { + players.Remove(lPlayer); + } + } + var listPlayers = players.Select(p => new { Id = p.Handle.Value, p.Name, p.Ping, FactionName = p.GetUser().Faction?.Name ?? "Zivilist", - }) ; + }); player.TriggerEvent("showPlayerlist", JsonConvert.SerializeObject(listPlayers)); } From d213369d70bac5c13ff4a5304c8d9132d06142a0 Mon Sep 17 00:00:00 2001 From: VegaZ Date: Fri, 2 Apr 2021 17:12:09 +0200 Subject: [PATCH 06/25] Fix OnlineListe 2 --- ReallifeGamemode.Server/Events/Key.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index e1631956..0cc8b7cb 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -615,7 +615,7 @@ namespace ReallifeGamemode.Server.Events foreach(var lPlayer in players) { - if(!lPlayer.IsLoggedIn()) + if(lPlayer.GetUser() == null) { players.Remove(lPlayer); } From e42170575a149013072bb4c9cb2db0e98373cba0 Mon Sep 17 00:00:00 2001 From: VegaZ Date: Fri, 2 Apr 2021 17:20:05 +0200 Subject: [PATCH 07/25] Fix OnlineListe 3 --- ReallifeGamemode.Server/Events/Key.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index 0cc8b7cb..cbc5e9e6 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -611,15 +611,7 @@ namespace ReallifeGamemode.Server.Events public void KeyPressO(Player player) { if (!player.IsLoggedIn()) return; - List players = NAPI.Pools.GetAllPlayers(); - - foreach(var lPlayer in players) - { - if(lPlayer.GetUser() == null) - { - players.Remove(lPlayer); - } - } + List players = NAPI.Pools.GetAllPlayers().Where(p => p.IsLoggedIn() == true).ToList(); var listPlayers = players.Select(p => new { From abd8576a9ba30ffa4a1d2bdb2e3b306327476815 Mon Sep 17 00:00:00 2001 From: VegaZ Date: Fri, 2 Apr 2021 18:38:25 +0200 Subject: [PATCH 08/25] Fix GW-Verteidigung gibt kein Geld --- ReallifeGamemode.Server/Gangwar/Turf.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReallifeGamemode.Server/Gangwar/Turf.cs b/ReallifeGamemode.Server/Gangwar/Turf.cs index bf6dd5cc..97850e87 100644 --- a/ReallifeGamemode.Server/Gangwar/Turf.cs +++ b/ReallifeGamemode.Server/Gangwar/Turf.cs @@ -288,9 +288,9 @@ namespace ReallifeGamemode.Server.Gangwar dbContext.Factions.Include(f => f.BankAccount).Where(f => f.Name == getOwner()).First().BankAccount.Balance += 10000; Turfs turf = dbContext.Turfs.Where(t => t.Id == getId()).FirstOrDefault(); turf.Owner = this.Owner; - turf.FactionId = dbContext.Factions.Where(f => f.Name == this.Owner).FirstOrDefault().Id; - dbContext.SaveChanges(); + turf.FactionId = dbContext.Factions.Where(f => f.Name == this.Owner).FirstOrDefault().Id; } + dbContext.SaveChanges(); } this.Attacker = null; foreach (var c in playerInGangwar) From 32577eecf7c2f80c6592d1fc5d7f2b63b807a520 Mon Sep 17 00:00:00 2001 From: "michael.reiswich" Date: Fri, 2 Apr 2021 19:53:24 +0200 Subject: [PATCH 09/25] adminShop --- .../Business/AdminDealerBusiness.cs | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 ReallifeGamemode.Server/Business/AdminDealerBusiness.cs diff --git a/ReallifeGamemode.Server/Business/AdminDealerBusiness.cs b/ReallifeGamemode.Server/Business/AdminDealerBusiness.cs new file mode 100644 index 00000000..21db1742 --- /dev/null +++ b/ReallifeGamemode.Server/Business/AdminDealerBusiness.cs @@ -0,0 +1,23 @@ +using GTANetworkAPI; + +namespace ReallifeGamemode.Server.Business +{ + internal class AdminDealerBusiness : CarDealerBusinessBase + { + public override int Id => 12; + + public override string Name => "Admin Carshop"; + + public override Vector3 Position => new Vector3(1295.3, 264.76,-49.05); + + public override Vector3 CarSpawnPositon => new Vector3(1266.38, 230.3, -48.67); + + public override float CarSpawnHeading => 176.6f; + + public override int? BlipSprite => 225; + + public override void Load() + { + } + } +} From 5364ddff59fd67f381f10d3bae33b2271ea9110e Mon Sep 17 00:00:00 2001 From: "michael.reiswich" Date: Fri, 2 Apr 2021 20:34:14 +0200 Subject: [PATCH 10/25] headshot raus? --- ReallifeGamemode.Client/util/weapondamage.ts | 8 ++++++++ ReallifeGamemode.Server/Business/AdminDealerBusiness.cs | 1 + ReallifeGamemode.Server/Events/Login.cs | 1 + 3 files changed, 10 insertions(+) diff --git a/ReallifeGamemode.Client/util/weapondamage.ts b/ReallifeGamemode.Client/util/weapondamage.ts index 49a7abe4..63877970 100644 --- a/ReallifeGamemode.Client/util/weapondamage.ts +++ b/ReallifeGamemode.Client/util/weapondamage.ts @@ -81,6 +81,14 @@ mp.game.invoke("0x4A3DC7ECCC321032", player, meelemodifier); //mp.gui.chat.push("Modifier: " + modifier + "MeeleModifier: " + meelemodifier); }); + + mp.events.add("entityStreamIn", (entity) => { + if (entity.type === "player") { + entity.setSuffersCriticalHits(false); + } + }); + + /*mp.events.add('playerWeaponShot', (targetPosition, targetEntity) => { for (var x in this.weaponAmmo) { if (this.weaponAmmo[x].id != this.currentWeapon) { diff --git a/ReallifeGamemode.Server/Business/AdminDealerBusiness.cs b/ReallifeGamemode.Server/Business/AdminDealerBusiness.cs index 21db1742..1800af8a 100644 --- a/ReallifeGamemode.Server/Business/AdminDealerBusiness.cs +++ b/ReallifeGamemode.Server/Business/AdminDealerBusiness.cs @@ -16,6 +16,7 @@ namespace ReallifeGamemode.Server.Business public override int? BlipSprite => 225; + public override void Load() { } diff --git a/ReallifeGamemode.Server/Events/Login.cs b/ReallifeGamemode.Server/Events/Login.cs index 7f4951a5..9db87c76 100644 --- a/ReallifeGamemode.Server/Events/Login.cs +++ b/ReallifeGamemode.Server/Events/Login.cs @@ -63,6 +63,7 @@ namespace ReallifeGamemode.Server.Events player.SetData("duty", false); player.SetData("Adminduty", false); player.TriggerEvent("SERVER:SET_HANDMONEY", user.Handmoney, 0); + player.TriggerEvent("headshotoff"); Gangwar.Gangwar.loadPlayer(player); if (user.FactionLeader) { From b032934f0e1232469e4c32694d5b6195fe0420c1 Mon Sep 17 00:00:00 2001 From: hydrant Date: Fri, 2 Apr 2021 20:48:48 +0200 Subject: [PATCH 11/25] whitelist status fallback --- ReallifeGamemode.Server/Events/Connect.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReallifeGamemode.Server/Events/Connect.cs b/ReallifeGamemode.Server/Events/Connect.cs index 813aca62..d468ddbf 100644 --- a/ReallifeGamemode.Server/Events/Connect.cs +++ b/ReallifeGamemode.Server/Events/Connect.cs @@ -30,7 +30,7 @@ namespace ReallifeGamemode.Server.Events bool registered = false; - var whitelistStatus = Managers.SVarManager.SVars.FirstOrDefault(v => v.Variable == "WhitelistStatus").Value; + var whitelistStatus = Managers.SVarManager.SVars.FirstOrDefault(v => v.Variable == "WhitelistStatus")?.Value ?? 0; using (var dbContext = new DatabaseContext()) { From 8cbab7ef15127d65e3d28ff77855c653347e41c6 Mon Sep 17 00:00:00 2001 From: hydrant Date: Fri, 2 Apr 2021 21:48:59 +0200 Subject: [PATCH 12/25] TUNING --- ReallifeGamemode.Client/Gui/blips.ts | 14 ++--- ReallifeGamemode.Client/Tuning/main.ts | 52 +++++++++++---- .../Managers/TuningManager.cs | 63 +++++++++++-------- 3 files changed, 84 insertions(+), 45 deletions(-) diff --git a/ReallifeGamemode.Client/Gui/blips.ts b/ReallifeGamemode.Client/Gui/blips.ts index da374ff0..a2912e22 100644 --- a/ReallifeGamemode.Client/Gui/blips.ts +++ b/ReallifeGamemode.Client/Gui/blips.ts @@ -12,20 +12,18 @@ export default function playerBlips() { var entityMp = entity; - mp.gui.chat.push("Player recieved: Yes"); + mp.gui.chat.push("Player recieved: Yes"); let color = parseInt(entity.getVariable("blipColor")); mp.gui.chat.push("Color : " + color); - entity.createBlip(1); + entity.createBlip(1); - mp.gui.chat.push(parseInt(entity.blip) == 0 ? "Blip was not created" : "Blip was created"); + mp.gui.chat.push(parseInt(entity.blip) == 0 ? "Blip was not created" : "Blip was created"); mp.gui.chat.push("entity.blip is actually " + entity.blip); - var blip = mp.blips.at(entity.blip); - - blip.dimension = entityMp.dimension; + var blip = entity.blip; mp.gui.chat.push("1 -" + blip.getAlpha() + " 2- " + blip.doesExist() + " 3-" + blip.dimension + " 4-" + entityMp.dimension); @@ -34,8 +32,8 @@ export default function playerBlips() { mp.game.invoke(Natives.SET_BLIP_CATEGORY, entity.blip, 7); mp.game.invoke(Natives.SHOW_HEADING_INDICATOR_ON_BLIP, entity.blip, true); mp.game.invoke(Natives.SET_BLIP_AS_SHORT_RANGE, entity.blip, true); - //mp.game.invoke(Natives.SET_BLIP_DISPLAY, entity.blip, 8); - + mp.game.invoke(Natives.SET_BLIP_DISPLAY, entity.blip, 8); + } }); */ diff --git a/ReallifeGamemode.Client/Tuning/main.ts b/ReallifeGamemode.Client/Tuning/main.ts index 0fdefbd4..e9dd9230 100644 --- a/ReallifeGamemode.Client/Tuning/main.ts +++ b/ReallifeGamemode.Client/Tuning/main.ts @@ -12,6 +12,7 @@ const Point = NativeUI.Point; const Color = NativeUI.Color; let screenRes = mp.game.graphics.getScreenResolution(0, 0); import vehicleColors from './colors'; +import moneyformat from '../moneyformat'; export default function tuning(globalData: IGlobalData) { var keyBound = false; @@ -53,6 +54,10 @@ export default function tuning(globalData: IGlobalData) { { Slot: 38, Name: "Hydraulik", Price: 2000 }, { Slot: 39, Name: "Motorabdeckung", Price: 2000 }, { Slot: 40, Name: "Luftfilter", Price: 2000 }, + { Slot: 41, Name: "Domstrebe", Price: 2000 }, + { Slot: 42, Name: "Scheinwerferabdeckung", Price: 2000 }, + { Slot: 43, Name: "Nebelscheinwerfer", Price: 2000 }, + { Slot: 44, Name: "Dach-Extra", Price: 2000 }, { Slot: 46, Name: "Fenster", Price: 2000 }, { Slot: 48, Name: "Design", Price: 2000 } ]; @@ -156,6 +161,10 @@ export default function tuning(globalData: IGlobalData) { } }); + var currentMod = new Array(); + var currentActiveModItem = new Array(); + var currentSelectedItem: VehicleModMenuItem = null; + mp.events.add("showTuningMenu", () => { mp.events.call("hideTuningInfo", false); mp.gui.chat.show(false); @@ -178,12 +187,8 @@ export default function tuning(globalData: IGlobalData) { repairItem.BackColor = new Color(94, 94, 94); repairItem.HighlightedBackColor = new Color(105, 105, 105); - var currentMod = new Array(); - var currentActiveModItem = new Array(); - carModTypes.forEach((modType) => { - - var mod = null; + var mod: number = null; if (modType === 22) { // Lichter var hlColor = localVehicle.getVariable("headlightColor"); @@ -221,6 +226,10 @@ export default function tuning(globalData: IGlobalData) { } } + mp.gui.chat.push("getting price for modtype = " + modType.toString() + ", modtypename = " + modName); + var price = getModSlotPrice(modType); + + if (mod === null) { mod = localVehicle.getMod(modType); } @@ -247,7 +256,8 @@ export default function tuning(globalData: IGlobalData) { modText = mp.game.ui.getLabelText(localVehicle.getModTextLabel(modType, x)); if (modText === "NULL") modText = getModName(localVehicle, modType, x); } - var item = new UIMenuItem(modText); + var item = new VehicleModMenuItem(modText); + item.price = price; modMenu.AddItem(item); if (x === mod) { @@ -255,6 +265,9 @@ export default function tuning(globalData: IGlobalData) { currentActiveModItem[modType] = item; modMenu.CurrentSelection = x; } + else { + item.SetRightLabel("$"+ moneyformat(price)); + } } modMenu.IndexChange.on((index: number) => { @@ -272,13 +285,13 @@ export default function tuning(globalData: IGlobalData) { } }); - modMenu.ItemSelect.on((item: NativeUI.UIMenuItem, index: number) => { - currentMod[modType] = index - 1; - currentActiveModItem[modType].SetRightBadge(BadgeStyle.None); - item.SetRightBadge(BadgeStyle.Car); - currentActiveModItem[modType] = item; + modMenu.ItemSelect.on((item: VehicleModMenuItem, index: number) => { + if (currentMod[modType] == index - 1) { + return; + } - mp.events.callRemote("setVehicleMod", modType, index); + currentSelectedItem = item; + mp.events.callRemote("setVehicleMod", modType, index, price); }); modMenu.MenuClose.on(() => { @@ -311,6 +324,13 @@ export default function tuning(globalData: IGlobalData) { }); + mp.events.add("SERVER:Tuning_ModSucessfull", (modType: number, index: number) => { + currentMod[modType] = index - 1; + currentActiveModItem[modType].SetRightLabel("$" + moneyformat(currentSelectedItem.price)); + currentSelectedItem.SetRightBadge(BadgeStyle.Car); + currentActiveModItem[modType] = currentSelectedItem; + }); + mp.events.add("playerLeaveVehicle", () => { if (keyBound) { mp.events.call("hideTuningInfo", true); @@ -435,6 +455,10 @@ export default function tuning(globalData: IGlobalData) { return realModName; } + function getModSlotPrice(modType: number): number { + return carModSlotName.filter(x => x.Slot == modType)[0].Price; + } + function setHeadlightsColor(vehicle, index) { if (!vehicle) { @@ -552,4 +576,8 @@ export default function tuning(globalData: IGlobalData) { mp.events.callRemote("CLIENT:TuningManager_SetVehicleColor", false, color); } + + class VehicleModMenuItem extends UIMenuItem { + public price: number; + } } \ No newline at end of file diff --git a/ReallifeGamemode.Server/Managers/TuningManager.cs b/ReallifeGamemode.Server/Managers/TuningManager.cs index b0580943..9a4d9cc9 100644 --- a/ReallifeGamemode.Server/Managers/TuningManager.cs +++ b/ReallifeGamemode.Server/Managers/TuningManager.cs @@ -92,8 +92,22 @@ namespace ReallifeGamemode.Server.Managers } [RemoteEvent("setVehicleMod")] - public void SetVehicleMod(Player player, int slot, int index) + public void SetVehicleMod(Player player, int slot, int index, int price) { + using var dbContext = new DatabaseContext(); + User user = player.GetUser(dbContext); + if (user.BankAccount.Balance < price) + { + player.SendNotification("Du hast nicht genug Geld für dieses Tuningteil!"); + return; + } + else + { + user.BankAccount.Balance -= price; + } + + player.TriggerEvent("SERVER:Tuning_ModSucessfull", slot, index); + Vehicle pV = player.Vehicle; if (index == 0) index--; @@ -118,41 +132,40 @@ namespace ReallifeGamemode.Server.Managers NAPI.ClientEvent.TriggerClientEventForAll("vehicleToggleMod", pV, slot, newVal); } - ServerVehicle sV = player.Vehicle.GetServerVehicle(); + dbContext.SaveChanges(); + + ServerVehicle sV = player.Vehicle.GetServerVehicle(dbContext); if (sV == null) return; - using (var dbContext = new DatabaseContext()) + VehicleMod vMod = dbContext.VehicleMods.FirstOrDefault(m => m.ServerVehicleId == sV.Id && m.Slot == slot); + if (vMod == null && index != -1) { - VehicleMod vMod = dbContext.VehicleMods.FirstOrDefault(m => m.ServerVehicleId == sV.Id && m.Slot == slot); - if (vMod == null && index != -1) + vMod = new VehicleMod + { + ServerVehicleId = sV.Id, + Slot = slot, + ModId = index + }; + dbContext.VehicleMods.Add(vMod); + } + else if (vMod != null && index == -1) + { + dbContext.VehicleMods.Remove(vMod); + } + else + { + if (vMod == null) { vMod = new VehicleMod { ServerVehicleId = sV.Id, - Slot = slot, - ModId = index + Slot = slot }; dbContext.VehicleMods.Add(vMod); } - else if (vMod != null && index == -1) - { - dbContext.VehicleMods.Remove(vMod); - } - else - { - if (vMod == null) - { - vMod = new VehicleMod - { - ServerVehicleId = sV.Id, - Slot = slot - }; - dbContext.VehicleMods.Add(vMod); - } - vMod.ModId = index; - } - dbContext.SaveChanges(); + vMod.ModId = index; } + dbContext.SaveChanges(); } [RemoteEvent("CLIENT:TuningManager_SetVehicleColor")] From 3e65964749658ae706915f190dc5a7ae94572c45 Mon Sep 17 00:00:00 2001 From: hydrant Date: Fri, 2 Apr 2021 21:56:32 +0200 Subject: [PATCH 13/25] WETTER --- .../Commands/AdminCommands.cs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 4f47f2b1..71fbd171 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -1995,22 +1995,6 @@ namespace ReallifeGamemode.Server.Commands return; } - bool found = false; - foreach (string w in Enum.GetNames(typeof(Weather))) - { - if (w.ToLower() == weather) - { - found = true; - break; - } - } - - if (!found) - { - ChatService.ErrorMessage(player, "Dieses Wetter existiert nicht"); - return; - } - Weather weatherBefore = NAPI.World.GetWeather(); NAPI.World.SetWeather(weather); Weather weatherAfter = NAPI.World.GetWeather(); From 899ae65b2cb4016d9344a11da4258bab9fe45998 Mon Sep 17 00:00:00 2001 From: hydrant Date: Fri, 2 Apr 2021 22:07:38 +0200 Subject: [PATCH 14/25] FIX TUNING --- ReallifeGamemode.Client/Tuning/main.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReallifeGamemode.Client/Tuning/main.ts b/ReallifeGamemode.Client/Tuning/main.ts index e9dd9230..f8e586a6 100644 --- a/ReallifeGamemode.Client/Tuning/main.ts +++ b/ReallifeGamemode.Client/Tuning/main.ts @@ -226,7 +226,6 @@ export default function tuning(globalData: IGlobalData) { } } - mp.gui.chat.push("getting price for modtype = " + modType.toString() + ", modtypename = " + modName); var price = getModSlotPrice(modType); @@ -327,7 +326,9 @@ export default function tuning(globalData: IGlobalData) { mp.events.add("SERVER:Tuning_ModSucessfull", (modType: number, index: number) => { currentMod[modType] = index - 1; currentActiveModItem[modType].SetRightLabel("$" + moneyformat(currentSelectedItem.price)); + currentActiveModItem[modType].SetRightBadge(NativeUI.BadgeStyle.None); currentSelectedItem.SetRightBadge(BadgeStyle.Car); + currentSelectedItem.SetRightLabel(""); currentActiveModItem[modType] = currentSelectedItem; }); From 64be514a3d3f8f42e74f47316c947886bf41d2f4 Mon Sep 17 00:00:00 2001 From: hydrant Date: Fri, 2 Apr 2021 22:20:32 +0200 Subject: [PATCH 15/25] HEADSHOT --- ReallifeGamemode.Client/util/weapondamage.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ReallifeGamemode.Client/util/weapondamage.ts b/ReallifeGamemode.Client/util/weapondamage.ts index 63877970..93e33621 100644 --- a/ReallifeGamemode.Client/util/weapondamage.ts +++ b/ReallifeGamemode.Client/util/weapondamage.ts @@ -1,4 +1,11 @@ export default function weapondamageUtil() { + + mp.players.local.setSuffersCriticalHits(false); + + mp.players.forEachInStreamRange((player) => { + player.setSuffersCriticalHits(false); + }); + mp.events.add('SERVER:WeaponModifier', (player) => { //mp.gui.chat.push("Modifier steht jetzt auf" + modifier); //mp.players.local.setWeaponDamageModifier(modifier); @@ -84,6 +91,7 @@ mp.events.add("entityStreamIn", (entity) => { if (entity.type === "player") { + mp.gui.chat.push("headshot entity stream in" + entity.name); entity.setSuffersCriticalHits(false); } }); From e8cb2f3f29f7a158e4783c5e73b9884ce6fc63c7 Mon Sep 17 00:00:00 2001 From: hydrant Date: Fri, 2 Apr 2021 22:21:15 +0200 Subject: [PATCH 16/25] SHOWTUNINGMENU KOSTENLOS --- ReallifeGamemode.Client/Tuning/main.ts | 4 ++-- ReallifeGamemode.Server/Commands/AdminCommands.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ReallifeGamemode.Client/Tuning/main.ts b/ReallifeGamemode.Client/Tuning/main.ts index f8e586a6..ec94766a 100644 --- a/ReallifeGamemode.Client/Tuning/main.ts +++ b/ReallifeGamemode.Client/Tuning/main.ts @@ -165,7 +165,7 @@ export default function tuning(globalData: IGlobalData) { var currentActiveModItem = new Array(); var currentSelectedItem: VehicleModMenuItem = null; - mp.events.add("showTuningMenu", () => { + mp.events.add("showTuningMenu", (noMoney) => { mp.events.call("hideTuningInfo", false); mp.gui.chat.show(false); @@ -226,7 +226,7 @@ export default function tuning(globalData: IGlobalData) { } } - var price = getModSlotPrice(modType); + var price = noMoney? 0 : getModSlotPrice(modType); if (mod === null) { diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 71fbd171..b081fd7f 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -2054,7 +2054,7 @@ namespace ReallifeGamemode.Server.Commands } else { - player.TriggerEvent("showTuningMenu"); + player.TriggerEvent("showTuningMenu", true); } } From da4d0d1de459e295a61d825b8825423f3e1cf8f4 Mon Sep 17 00:00:00 2001 From: hydrant Date: Fri, 2 Apr 2021 22:27:48 +0200 Subject: [PATCH 17/25] MEELE --- ReallifeGamemode.Client/util/weapondamage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReallifeGamemode.Client/util/weapondamage.ts b/ReallifeGamemode.Client/util/weapondamage.ts index 93e33621..32a0779d 100644 --- a/ReallifeGamemode.Client/util/weapondamage.ts +++ b/ReallifeGamemode.Client/util/weapondamage.ts @@ -44,7 +44,7 @@ break; case 0x624FE830: //Compactrifle modifier = 0.2; - meelemodifier = 1; + meelemodifier = 0.1; break; case 0x05FC3C11: //Sniperrifle modifier = 0.5; From 53067fd14d565c2ba175baea123a59de1a986a38 Mon Sep 17 00:00:00 2001 From: hydrant Date: Fri, 2 Apr 2021 23:05:26 +0200 Subject: [PATCH 18/25] ADMIN SHOP KEIN BLIP --- ReallifeGamemode.Server/Business/AdminDealerBusiness.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ReallifeGamemode.Server/Business/AdminDealerBusiness.cs b/ReallifeGamemode.Server/Business/AdminDealerBusiness.cs index 1800af8a..b009c641 100644 --- a/ReallifeGamemode.Server/Business/AdminDealerBusiness.cs +++ b/ReallifeGamemode.Server/Business/AdminDealerBusiness.cs @@ -14,8 +14,7 @@ namespace ReallifeGamemode.Server.Business public override float CarSpawnHeading => 176.6f; - public override int? BlipSprite => 225; - + public override int? BlipSprite => null; public override void Load() { From df1a29ae990e9406b07038e4fa7045cc424206c6 Mon Sep 17 00:00:00 2001 From: hydrant Date: Fri, 2 Apr 2021 23:42:50 +0200 Subject: [PATCH 19/25] VOICE BUG WECH --- ReallifeGamemode.Client/Voice/main.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ReallifeGamemode.Client/Voice/main.ts b/ReallifeGamemode.Client/Voice/main.ts index 97d902db..eccf7c9d 100644 --- a/ReallifeGamemode.Client/Voice/main.ts +++ b/ReallifeGamemode.Client/Voice/main.ts @@ -62,7 +62,7 @@ export default function voice(globalData: IGlobalData) { listeners.splice(idx, 1); } - mp.events.callRemote("CLIENT:RemoveVoiceListener"); + mp.events.callRemote("CLIENT:RemoveVoiceListener", target); } setInterval(() => { @@ -83,7 +83,7 @@ export default function voice(globalData: IGlobalData) { }); listeners.forEach((player: PlayerMp) => { - if (player) { + if (player && mp.players.exists(player)) { if (player.handle !== 0) { const playerPos = player.position; let dist = mp.game.system.vdist(playerPos.x, playerPos.y, playerPos.z, localPos.x, localPos.y, localPos.z); @@ -98,6 +98,9 @@ export default function voice(globalData: IGlobalData) { removeListener(player); } } + else { + removeListener(player); + } }) }, 500) } From 96b43b6f8c1c94bafaecc61c974f185696171b9f Mon Sep 17 00:00:00 2001 From: hydrant Date: Fri, 2 Apr 2021 23:52:34 +0200 Subject: [PATCH 20/25] taxifahrer raus mit die viecher --- ReallifeGamemode.Server/Job/JobBase.cs | 2 ++ ReallifeGamemode.Server/Job/TaxiDriverJob.cs | 2 ++ ReallifeGamemode.Server/Managers/JobManager.cs | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/ReallifeGamemode.Server/Job/JobBase.cs b/ReallifeGamemode.Server/Job/JobBase.cs index e10a76ed..7b4488d3 100644 --- a/ReallifeGamemode.Server/Job/JobBase.cs +++ b/ReallifeGamemode.Server/Job/JobBase.cs @@ -28,6 +28,8 @@ namespace ReallifeGamemode.Server.Job public abstract bool NeedVehicleToStart { get; } + public virtual bool Deactivated => false; + public void StartJob(Player player) { if (_inJob.Contains(player)) return; diff --git a/ReallifeGamemode.Server/Job/TaxiDriverJob.cs b/ReallifeGamemode.Server/Job/TaxiDriverJob.cs index 4ccfa110..0b4f9b12 100644 --- a/ReallifeGamemode.Server/Job/TaxiDriverJob.cs +++ b/ReallifeGamemode.Server/Job/TaxiDriverJob.cs @@ -25,6 +25,8 @@ namespace ReallifeGamemode.Server.Job public override bool NeedVehicleToStart => true; + public override bool Deactivated => true; + private static TaxiDriverJob _Instance; public TaxiDriverJob() diff --git a/ReallifeGamemode.Server/Managers/JobManager.cs b/ReallifeGamemode.Server/Managers/JobManager.cs index 7360b6dc..ee82abd5 100644 --- a/ReallifeGamemode.Server/Managers/JobManager.cs +++ b/ReallifeGamemode.Server/Managers/JobManager.cs @@ -34,6 +34,12 @@ namespace ReallifeGamemode.Server.Managers { throw new InvalidOperationException($"Double Job ID found: {instance.Id} | {instance.Name}"); } + + if (instance.Deactivated) + { + NAPI.Util.ConsoleOutput("Job {0} is deactivated", instance.Name); + continue; + } _jobs.Add(instance); NAPI.Util.ConsoleOutput($"Loading job {instance.Name}"); } From 62c92f56cf24a828b565778a1ffa30ecaff29634 Mon Sep 17 00:00:00 2001 From: hydrant Date: Sat, 3 Apr 2021 00:05:52 +0200 Subject: [PATCH 21/25] item aufheben textlabel --- ReallifeGamemode.Server/Inventory/GroundItem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReallifeGamemode.Server/Inventory/GroundItem.cs b/ReallifeGamemode.Server/Inventory/GroundItem.cs index 0fe1033c..25f8dcb6 100644 --- a/ReallifeGamemode.Server/Inventory/GroundItem.cs +++ b/ReallifeGamemode.Server/Inventory/GroundItem.cs @@ -34,7 +34,7 @@ namespace ReallifeGamemode.Server.Inventory var invWeight = InventoryManager.GetUserInventoryWeight(player); var itemsToAdd = 0; GTANetworkAPI.Object nearestObject = GroundObjects.FirstOrDefault(d => d.Position == nearest.Position); - TextLabel nearestTextLabel = GroundTextLabels.FirstOrDefault(d => d.Position == new Vector3(nearest.Position.X, nearest.Position.Y, nearest.Position.Z + 1.05) || d.Position == new Vector3(nearest.Position.X, nearest.Position.Y, nearest.Position.Z + 0.8)); + TextLabel nearestTextLabel = GroundTextLabels.FirstOrDefault(d => d.Position == new Vector3(nearest.Position.X, nearest.Position.Y, nearest.Position.Z + 1.05) || d.Position == new Vector3(nearest.Position.X, nearest.Position.Y, nearest.Position.Z + 0.8) || d.Position == nearest.Position); IItem nearestItem = InventoryManager.GetItemById(nearest.ItemId); UserItem existingItem = InventoryManager.UserHasThisItem(player, nearest.ItemId); var user = player.GetUser(); From b4326c11cc4d5418561563dfcd839444531eb971 Mon Sep 17 00:00:00 2001 From: hydrant Date: Sat, 3 Apr 2021 00:07:10 +0200 Subject: [PATCH 22/25] inventar?? --- .../assets/html/inventory/inventory.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ReallifeGamemode.Client/assets/html/inventory/inventory.html b/ReallifeGamemode.Client/assets/html/inventory/inventory.html index 8c1002d1..ff0a9a88 100644 --- a/ReallifeGamemode.Client/assets/html/inventory/inventory.html +++ b/ReallifeGamemode.Client/assets/html/inventory/inventory.html @@ -54,7 +54,7 @@
Rucksack
-
    +
    @@ -74,7 +74,7 @@
    -
      +
      @@ -483,7 +483,7 @@ row = 6; } - var Litem = document.createElement("li"); + var Litem = document.createElement("div"); Litem.setAttribute("class", "item" + row); Litem.setAttribute("id", i); Litem.setAttribute("name", "List" + item.Category); From dacaf84cf7e226cc2f51f3f63d4b27d1d8e87d70 Mon Sep 17 00:00:00 2001 From: "michael.reiswich" Date: Sat, 3 Apr 2021 11:51:27 +0200 Subject: [PATCH 23/25] change Gangwar-time & change KH-time & edit Indroduction & change help & delete Ahelp --- ReallifeGamemode.Client/Gui/deathscreen.ts | 2 +- .../assets/html/Introduction/Introduction.html | 8 +++++++- ReallifeGamemode.Client/util/Gangwar.ts | 3 --- ReallifeGamemode.Client/util/weapondamage.ts | 1 - ReallifeGamemode.Server/Commands/AdminCommands.cs | 4 ++-- ReallifeGamemode.Server/Commands/UserCommands.cs | 7 ++++++- ReallifeGamemode.Server/Gangwar/Turf.cs | 6 ++---- ReallifeGamemode.Server/Util/AttachmentSync.cs | 3 ++- 8 files changed, 20 insertions(+), 14 deletions(-) diff --git a/ReallifeGamemode.Client/Gui/deathscreen.ts b/ReallifeGamemode.Client/Gui/deathscreen.ts index f5f4de52..375f989a 100644 --- a/ReallifeGamemode.Client/Gui/deathscreen.ts +++ b/ReallifeGamemode.Client/Gui/deathscreen.ts @@ -18,7 +18,7 @@ export default function deathScreen() { var fade; var deathDate: Date; var taskTimeout = false; - const maxDeathTime = 30; + const maxDeathTime = 120; const medicJobTime = maxDeathTime * -1; mp.game.gameplay.setFadeOutAfterDeath(false); diff --git a/ReallifeGamemode.Client/assets/html/Introduction/Introduction.html b/ReallifeGamemode.Client/assets/html/Introduction/Introduction.html index b0a76111..bff3aa9c 100644 --- a/ReallifeGamemode.Client/assets/html/Introduction/Introduction.html +++ b/ReallifeGamemode.Client/assets/html/Introduction/Introduction.html @@ -18,7 +18,11 @@

      Willkommen auf Life of German

      - In dieser Info findest du alles wichtige zum Thema Steuerung und Funktionen.

      + Was sind die ersten Schritte wirst du dich jetzt bestimmt fragen. Hier ein kleiner Guide.

      + 1. Mach deine Scheine (Führerschein, Flugschein, Waffenschein)
      + 2. Nimm einen Job in der Stadthalle an und verdien dir dein erstes Geld.
      + 3. Kauf dir ein eigenes Auto.
      + 4. Tritt einer Fraktion bei

      Steuerung:
      T - Chat öffnen
      @@ -27,6 +31,8 @@ N - Fahrzeugmotor Starten
      O - Onlineliste öffnen/schließen
      I - Inventar öffnen/schließen
      + f4 - Mikrofon an und aus stellen

      + Mit /help kannst du dir jederzeit die Steuerung angucken. Und nun viel Spaß auf unseren Server.
      diff --git a/ReallifeGamemode.Client/util/Gangwar.ts b/ReallifeGamemode.Client/util/Gangwar.ts index d0d49ff2..102908c0 100644 --- a/ReallifeGamemode.Client/util/Gangwar.ts +++ b/ReallifeGamemode.Client/util/Gangwar.ts @@ -499,9 +499,6 @@ z++ } - mp.gui.chat.push("DEBUG: Turf blips not removed: " + x + " / " + n); - mp.gui.chat.push("DEBUG: Attack blips not removed: " + y); - mp.gui.chat.push("DEBUG: LeaderBlips blips not removed: " + z); } mp.events.add('GangAreas:Create', (turfsJSON) => { diff --git a/ReallifeGamemode.Client/util/weapondamage.ts b/ReallifeGamemode.Client/util/weapondamage.ts index 32a0779d..1635c09b 100644 --- a/ReallifeGamemode.Client/util/weapondamage.ts +++ b/ReallifeGamemode.Client/util/weapondamage.ts @@ -91,7 +91,6 @@ mp.events.add("entityStreamIn", (entity) => { if (entity.type === "player") { - mp.gui.chat.push("headshot entity stream in" + entity.name); entity.setSuffersCriticalHits(false); } }); diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index b081fd7f..1a99b053 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -144,7 +144,7 @@ namespace ReallifeGamemode.Server.Commands #region ahelp - [Command("ahelp", "~m~Benutzung: ~s~/ahelp")] + /* [Command("ahelp", "~m~Benutzung: ~s~/ahelp")] public void CmdAdminHelp(Player player) { if (!player.GetUser()?.IsAdmin(AdminLevel.MAPPING) ?? true) @@ -170,7 +170,7 @@ namespace ReallifeGamemode.Server.Commands } } } - + */ #endregion ahelp #region Mapping / Entwicklung diff --git a/ReallifeGamemode.Server/Commands/UserCommands.cs b/ReallifeGamemode.Server/Commands/UserCommands.cs index e7fc06b7..3ed5bc5d 100644 --- a/ReallifeGamemode.Server/Commands/UserCommands.cs +++ b/ReallifeGamemode.Server/Commands/UserCommands.cs @@ -79,7 +79,12 @@ namespace ReallifeGamemode.Server.Commands [Command("help", "~m~Benutzung: ~s~/help")] public void CmdHelp(Player player) { - player.TriggerEvent("showUserhelp"); + player.SendChatMessage("M - Interaktionsmenü öffnen und schließen"); + player.SendChatMessage("X - Fahrzeug auf -/ abschließen sowie im Fahrzeuginteraktionsmenü öffnen"); + player.SendChatMessage("N - Fahrzeugmotor Starten"); + player.SendChatMessage("O - Onlineliste öffnen / schließen"); + player.SendChatMessage("I - Inventar öffnen / schließen"); + player.SendChatMessage("f4 - Mikrofon an/aus schalten"); } [Command("hup")] diff --git a/ReallifeGamemode.Server/Gangwar/Turf.cs b/ReallifeGamemode.Server/Gangwar/Turf.cs index 97850e87..3000d1ec 100644 --- a/ReallifeGamemode.Server/Gangwar/Turf.cs +++ b/ReallifeGamemode.Server/Gangwar/Turf.cs @@ -118,11 +118,9 @@ namespace ReallifeGamemode.Server.Gangwar { var t = Task.Factory.StartNew(() => { - ChatService.Broadcast("DEBUG: reloadGangTurfs(...)"); Task.Delay(10000).Wait(); Gangwar.loadTurfs(); Gangwar.loadTurfs_ToAllPlayers(); - ChatService.Broadcast("DEBUG: reloadGangTurfs()...10 Sekunden um"); }); t.Wait(); @@ -167,7 +165,7 @@ namespace ReallifeGamemode.Server.Gangwar foreach (Player gangwarPlayer in this.playerInGangwar) { - gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score, 40 - timerCount); + gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score, 900 - timerCount); } /*if (this.Att_Score >= 200) { @@ -178,7 +176,7 @@ namespace ReallifeGamemode.Server.Gangwar this.takeOver(this.Owner); }*/ timerCount += 1; - if (timerCount >= 40) //change to 900 (seconds) before release for testing reasons change to whatever you like + if (timerCount >= 900) //change to 900 (seconds) before release for testing reasons change to whatever you like { if (this.Att_Score > this.Def_Score) { diff --git a/ReallifeGamemode.Server/Util/AttachmentSync.cs b/ReallifeGamemode.Server/Util/AttachmentSync.cs index 40ae8e55..ef3fccf8 100644 --- a/ReallifeGamemode.Server/Util/AttachmentSync.cs +++ b/ReallifeGamemode.Server/Util/AttachmentSync.cs @@ -137,7 +137,7 @@ public class AttachmentSyncExample : Script player.AddAttachment(Base36Extensions.FromBase36(hash), true); } - [Command("xdd")] + /* [Command("xdd")] public void attachment(Player player) { Vehicle veh = player.Vehicle; @@ -152,6 +152,7 @@ public class AttachmentSyncExample : Script veh.ClearAttachments(); } } + */ } From 894ae7465fbf493751d40f6afe92a0b9c230434d Mon Sep 17 00:00:00 2001 From: "michael.reiswich" Date: Sat, 3 Apr 2021 12:35:19 +0200 Subject: [PATCH 24/25] change tuning prices --- ReallifeGamemode.Client/Gui/blips.ts | 4 +- ReallifeGamemode.Client/Tuning/main.ts | 56 +++++++++---------- .../html/Introduction/Introduction.html | 11 ++-- .../Commands/UserCommands.cs | 2 +- 4 files changed, 37 insertions(+), 36 deletions(-) diff --git a/ReallifeGamemode.Client/Gui/blips.ts b/ReallifeGamemode.Client/Gui/blips.ts index a2912e22..87c46329 100644 --- a/ReallifeGamemode.Client/Gui/blips.ts +++ b/ReallifeGamemode.Client/Gui/blips.ts @@ -42,10 +42,10 @@ export default function playerBlips() { mp.events.addDataHandler("blipColor", (entity, value) => { if (entity.type === "player") { - mp.gui.chat.push("Setting Blip color..."); + //mp.gui.chat.push("Setting Blip color..."); let color = parseInt(value); entity.setBlipColor(isNaN(color) ? 0 : color); - mp.gui.chat.push("Player blip color was set."); + // mp.gui.chat.push("Player blip color was set."); } }); } \ No newline at end of file diff --git a/ReallifeGamemode.Client/Tuning/main.ts b/ReallifeGamemode.Client/Tuning/main.ts index ec94766a..9da9b31b 100644 --- a/ReallifeGamemode.Client/Tuning/main.ts +++ b/ReallifeGamemode.Client/Tuning/main.ts @@ -25,40 +25,40 @@ export default function tuning(globalData: IGlobalData) { const carModTypes = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 18, 22, -1, 25, 27, 28, 33, 34, 35, 38, 39, 40, 41, 42, 43, 44, 46, 48, 69]; const carModSlotName = [ - { Slot: 0, Name: "Spoiler", Price: 2000 }, - { Slot: 1, Name: "Frontstoßstange", Price: 2000}, - { Slot: 2, Name: "Heckstoßstange", Price: 2000 }, - { Slot: 3, Name: "Seitenschweller", Price: 2000 }, - { Slot: 4, Name: "Auspuff", Price: 2000 }, - { Slot: 5, Name: "Rahmen", Price: 2000 }, - { Slot: 6, Name: "Kühlergrill", Price: 2000 }, + { Slot: 0, Name: "Spoiler", Price: 1000 }, + { Slot: 1, Name: "Frontstoßstange", Price: 1500}, + { Slot: 2, Name: "Heckstoßstange", Price: 1500 }, + { Slot: 3, Name: "Seitenschweller", Price: 1500 }, + { Slot: 4, Name: "Auspuff", Price: 500 }, + { Slot: 5, Name: "Rahmen", Price: 1000 }, + { Slot: 6, Name: "Kühlergrill", Price: 1000 }, { Slot: 7, Name: "Motorhaube", Price: 2000 }, { Slot: 8, Name: "Extra 1", Price: 2000 }, { Slot: 9, Name: "Extra 2", Price: 2000 }, - { Slot: 10, Name: "Dach", Price: 2000 }, - { Slot: 11, Name: "Motor", Price: 2000 }, - { Slot: 12, Name: "Bremsen", Price: 2000 }, - { Slot: 13, Name: "Getriebe", Price: 2000 }, - { Slot: 14, Name: "Hupe", Price: 2000 }, + { Slot: 10, Name: "Dach", Price: 1500 }, + { Slot: 11, Name: "Motor", Price: 50000 }, + { Slot: 12, Name: "Bremsen", Price: 30000 }, + { Slot: 13, Name: "Getriebe", Price: 15000 }, + { Slot: 14, Name: "Hupe", Price: 500 }, { Slot: 15, Name: "Federung", Price: 2000 }, - { Slot: 18, Name: "Turbo", Price: 2000 }, - { Slot: 22, Name: "Licht", Price: 2000 }, - { Slot: 23, Name: "Reifen", Price: 2000 }, - { Slot: -1, Name: "Lackierung", Price: 2000 }, - { Slot: 25, Name: "Nummernschildhalter", Price: 2000 }, - { Slot: 27, Name: "Innenausstatung", Price: 2000 }, - { Slot: 28, Name: "Wackelkopf", Price: 2000 }, - { Slot: 33, Name: "Lenkrad", Price: 2000 }, - { Slot: 34, Name: "Schalthebel", Price: 2000 }, - { Slot: 35, Name: "Schild", Price: 2000 }, + { Slot: 18, Name: "Turbo", Price: 40000 }, + { Slot: 22, Name: "Licht", Price: 500 }, + { Slot: 23, Name: "Reifen", Price: 1000 }, + { Slot: -1, Name: "Lackierung", Price: 1000 }, + { Slot: 25, Name: "Nummernschildhalter", Price: 500 }, + { Slot: 27, Name: "Innenausstatung", Price: 500 }, + { Slot: 28, Name: "Wackelkopf", Price: 200 }, + { Slot: 33, Name: "Lenkrad", Price: 300 }, + { Slot: 34, Name: "Schalthebel", Price: 200 }, + { Slot: 35, Name: "Schild", Price: 200 }, { Slot: 38, Name: "Hydraulik", Price: 2000 }, { Slot: 39, Name: "Motorabdeckung", Price: 2000 }, - { Slot: 40, Name: "Luftfilter", Price: 2000 }, - { Slot: 41, Name: "Domstrebe", Price: 2000 }, - { Slot: 42, Name: "Scheinwerferabdeckung", Price: 2000 }, - { Slot: 43, Name: "Nebelscheinwerfer", Price: 2000 }, - { Slot: 44, Name: "Dach-Extra", Price: 2000 }, - { Slot: 46, Name: "Fenster", Price: 2000 }, + { Slot: 40, Name: "Luftfilter", Price: 1000 }, + { Slot: 41, Name: "Domstrebe", Price: 1000 }, + { Slot: 42, Name: "Scheinwerferabdeckung", Price: 500 }, + { Slot: 43, Name: "Nebelscheinwerfer", Price: 1000 }, + { Slot: 44, Name: "Dach-Extra", Price: 1000 }, + { Slot: 46, Name: "Fenster", Price: 1000 }, { Slot: 48, Name: "Design", Price: 2000 } ]; diff --git a/ReallifeGamemode.Client/assets/html/Introduction/Introduction.html b/ReallifeGamemode.Client/assets/html/Introduction/Introduction.html index bff3aa9c..497b8ce4 100644 --- a/ReallifeGamemode.Client/assets/html/Introduction/Introduction.html +++ b/ReallifeGamemode.Client/assets/html/Introduction/Introduction.html @@ -19,10 +19,11 @@
      Was sind die ersten Schritte wirst du dich jetzt bestimmt fragen. Hier ein kleiner Guide.

      - 1. Mach deine Scheine (Führerschein, Flugschein, Waffenschein)
      - 2. Nimm einen Job in der Stadthalle an und verdien dir dein erstes Geld.
      - 3. Kauf dir ein eigenes Auto.
      - 4. Tritt einer Fraktion bei

      + 1. Wenn du zum ersten mal Connectest würden wir dich bitten das Spiel nochmal neu zu Starten damit alle Daten auch zu 100% richtig geladen sind. Danke
      + 2. Mach deine Scheine (Führerschein, Flugschein, Waffenschein)
      + 3. Nimm einen Job in der Stadthalle an und verdien dir dein erstes Geld.
      + 4. Kauf dir ein eigenes Auto.
      + 5. Tritt einer Fraktion bei

      Steuerung:
      T - Chat öffnen
      @@ -31,7 +32,7 @@ N - Fahrzeugmotor Starten
      O - Onlineliste öffnen/schließen
      I - Inventar öffnen/schließen
      - f4 - Mikrofon an und aus stellen

      + F4 - Mikrofon an und aus stellen

      Mit /help kannst du dir jederzeit die Steuerung angucken. Und nun viel Spaß auf unseren Server.
      diff --git a/ReallifeGamemode.Server/Commands/UserCommands.cs b/ReallifeGamemode.Server/Commands/UserCommands.cs index 3ed5bc5d..91dabc04 100644 --- a/ReallifeGamemode.Server/Commands/UserCommands.cs +++ b/ReallifeGamemode.Server/Commands/UserCommands.cs @@ -84,7 +84,7 @@ namespace ReallifeGamemode.Server.Commands player.SendChatMessage("N - Fahrzeugmotor Starten"); player.SendChatMessage("O - Onlineliste öffnen / schließen"); player.SendChatMessage("I - Inventar öffnen / schließen"); - player.SendChatMessage("f4 - Mikrofon an/aus schalten"); + player.SendChatMessage("F4 - Mikrofon an/aus schalten"); } [Command("hup")] From 0543775330dd425f0eb8994afb5af4572d628f22 Mon Sep 17 00:00:00 2001 From: "michael.reiswich" Date: Sat, 3 Apr 2021 16:06:44 +0200 Subject: [PATCH 25/25] Changes on Attachment Manager. Removed attachment due to failure in attachment manager. Changed Database to Live Database -> will be changed after Master merge Add to enteties.ts RageObject and RageObjectPool for Attachment Manager --- .../core/rage-mp/entities.ts | 54 +++++++++++- ReallifeGamemode.Client/core/rage-mp/game.ts | 5 +- ReallifeGamemode.Client/game.ts | 11 +++ .../util/attachmentMngr.ts | 87 +++++++++++++++---- .../Models/DatabaseContext.cs | 2 +- ReallifeGamemode.Server/Events/Disconnect.cs | 3 +- ReallifeGamemode.Server/Events/Key.cs | 3 +- .../Inventory/GroundItem.cs | 2 +- .../Job/RefuseCollectorJob.cs | 4 +- .../Managers/PositionManager.cs | 2 +- .../Util/AttachmentSync.cs | 4 +- 11 files changed, 147 insertions(+), 30 deletions(-) diff --git a/ReallifeGamemode.Client/core/rage-mp/entities.ts b/ReallifeGamemode.Client/core/rage-mp/entities.ts index 42130b45..2a519e70 100644 --- a/ReallifeGamemode.Client/core/rage-mp/entities.ts +++ b/ReallifeGamemode.Client/core/rage-mp/entities.ts @@ -1,9 +1,11 @@ -import { IEntity, IPlayer, IEntityAttachments, IEntityAttachmentPool, IPlayerPool, IVehicle, IVehiclePool, VehicleSeat, EntityType } from "../../game"; +import { IEntity, IPlayer, IEntityAttachments, IEntityAttachmentPool, IPlayerPool, IVehicle, IVehiclePool, VehicleSeat, EntityType, IObjectPool, IObject } from "../../game"; import { parseJson } from "../../util"; import game from "../.."; class RageEntity implements IEntity { private entity: EntityMp; + public __attachments: any[]; + public __attachmentObjects: any[]; get id(): number { if (!this.entity) { @@ -57,8 +59,6 @@ class RageEntity implements IEntity { class RagePlayer extends RageEntity implements IPlayer { private player: PlayerMp; - public __attachments: any[]; - public __attachmentObjects: any[]; get name(): string { return this.player.name; @@ -176,6 +176,20 @@ class RagePlayerPool implements IPlayerPool { } } +class RageObject extends RageEntity implements IObject { + public object: ObjectMp; + public __attachmentData: object; + + constructor(object: ObjectMp, attachmentData: object) { + if (!object) { + throw "Object is undefined" + } + super(object); + this.object = object; + this.__attachmentData = attachmentData; + } +} + class RageVehicle extends RageEntity implements IVehicle { private vehicle: VehicleMp; @@ -212,6 +226,38 @@ class RageVehicle extends RageEntity implements IVehicle { } } + +class RageObjectPool implements IObjectPool { + public attachmentDataMap: Map; + + + setData(entity: ObjectMp, attachmentData: object): void { + if (!this.attachmentDataMap) + this.attachmentDataMap = new Map(); + + this.attachmentDataMap.set(entity, attachmentData); + } + + at(id: number): IObject { + var object = mp.objects.atRemoteId(Number(id)); + + if (!object) + return null; + + return new RageObject(object, this.attachmentDataMap.get(object)); + } + + forEach(fn: (entity: IObject) => void): void { + mp.objects.forEach(e => { + if (!e) { + game.ui.sendChatMessage("forEach - e is null"); + return; + } + fn(new RageObject(e, this.attachmentDataMap.get(e))); + }) + } +} + class RageVehiclePool implements IVehiclePool { at(id: number): IVehicle { var veh = mp.vehicles.atRemoteId(Number(id)); @@ -242,4 +288,6 @@ export { RageEntityAttachmentPool, RageVehicle, RageVehiclePool, + RageObject, + RageObjectPool, } \ No newline at end of file diff --git a/ReallifeGamemode.Client/core/rage-mp/game.ts b/ReallifeGamemode.Client/core/rage-mp/game.ts index 5094ba9f..106f21fb 100644 --- a/ReallifeGamemode.Client/core/rage-mp/game.ts +++ b/ReallifeGamemode.Client/core/rage-mp/game.ts @@ -1,12 +1,13 @@ -import { IGame, IUi, IEvents, IPlayerPool, IVehiclePool, IEntityAttachmentPool } from "../../game"; +import { IGame, IUi, IEvents, IPlayerPool, IVehiclePool, IEntityAttachmentPool, IObjectPool } from "../../game"; import RageEvents from "./events"; import RageUi from "./ui"; -import { RagePlayerPool, RageVehiclePool, RageEntityAttachmentPool } from "./entities"; +import { RagePlayerPool, RageVehiclePool, RageEntityAttachmentPool, RageObjectPool } from "./entities"; export default class RageGame implements IGame { players: IPlayerPool = new RagePlayerPool(); vehicles: IVehiclePool = new RageVehiclePool(); attachments: IEntityAttachmentPool = new RageEntityAttachmentPool(); + objects: IObjectPool = new RageObjectPool(); events: IEvents = new RageEvents; ui: IUi = new RageUi; diff --git a/ReallifeGamemode.Client/game.ts b/ReallifeGamemode.Client/game.ts index 4ae798f5..1ed19923 100644 --- a/ReallifeGamemode.Client/game.ts +++ b/ReallifeGamemode.Client/game.ts @@ -6,6 +6,7 @@ players: IPlayerPool; vehicles: IVehiclePool; attachments: IEntityAttachmentPool; + objects: IObjectPool; disableDefaultEngineBehaviour(): void; } @@ -54,6 +55,10 @@ interface IPlayer extends IEntity { vehicle: IVehicle; } +interface IObject extends IEntity { + __attachmentData: object; +} + interface IEntityAttachments { remoteId: any; __attachments: any[]; @@ -74,6 +79,10 @@ interface IEntityPool { forEach(fn: (entity: TEntity) => void): void; } +interface IObjectPool extends IEntityPool { + setData(entity: ObjectMp, attachmentData: object): void; +} + interface IPlayerPool extends IEntityPool { local: IPlayer; } @@ -149,6 +158,7 @@ export { IBrowser, IPlayer, + IObject, IEntityAttachments, IEntityAttachmentPool, IVehicle, @@ -156,6 +166,7 @@ export { IEntityPool, IPlayerPool, IVehiclePool, + IObjectPool, EventName, Key, diff --git a/ReallifeGamemode.Client/util/attachmentMngr.ts b/ReallifeGamemode.Client/util/attachmentMngr.ts index 6c9b8803..e4be9a8f 100644 --- a/ReallifeGamemode.Client/util/attachmentMngr.ts +++ b/ReallifeGamemode.Client/util/attachmentMngr.ts @@ -23,40 +23,62 @@ export default function attachmentManager(game: IGame) { return; } - ++attachId; let entity: IEntity; if (entityRage.type === "player") { var player = game.players.at(entityRage.remoteId); entity = player; - mp.gui.chat.push(`ATTACH: ${attachId} - Player: ${player.name}`); } else if (entityRage.type === "vehicle") { var vehicle = game.vehicles.at(entityRage.remoteId); entity = vehicle; var realName = mp.game.ui.getLabelText(mp.game.vehicle.getDisplayNameFromVehicleModel(entityRage.model)); - mp.gui.chat.push(`ATTACH: ${attachId} - Vehicle: ${vehicle.remoteId}, ${realName}`); + } else if (entityRage.type === "object") { + return; } + + + + let e = game.attachments.get(entity); if (this.attachments.hasOwnProperty(id)) { - if (e.__attachmentObjects == undefined) { e.__attachmentObjects = []; } + + + if (!e.__attachmentObjects) { e.__attachmentObjects = []; } + + if (!e.__attachmentObjects.hasOwnProperty(id)) { + + let attInfo = this.attachments[id]; - let object = mp.objects.new(attInfo.model, entityRage.position); + let rageObject = mp.objects.new(attInfo.model, entityRage.position); + var bone = (typeof (attInfo.boneName) === 'string') ? entityRage.getBoneIndexByName(attInfo.boneName) : entityRage.getBoneIndex(attInfo.boneName) + let attachmentData = { + targetEntity: entity.id, + bone: bone, + offset: attInfo.offset, + rotation: attInfo.rotation + }; + + game.objects.setData(rageObject, attachmentData); // hier hakt es mein freund + + let object = game.objects.at(rageObject.remoteId); + + //DEBUG MSG mp.gui.chat.push(`ATTACH: ${attachId} - bone = ${bone}`) - object.attachTo(entity.id, - bone, - attInfo.offset.x, attInfo.offset.y, attInfo.offset.z, - attInfo.rotation.x, attInfo.rotation.y, attInfo.rotation.z, - false, false, false, false, 2, true); + rageObject.notifyStreaming = true; + mp.gui.chat.push("Notified Stream."); + game.wait(200); + + //DEBUG MSG mp.gui.chat.push(`ATTACH: ${attachId} - Attaching ${JSON.stringify(attInfo)}`); - e.__attachmentObjects[id] = object; + e.__attachmentObjects[id] = rageObject;; } } /* else { @@ -187,15 +209,46 @@ export default function attachmentManager(game: IGame) { mp.events.add("entityStreamIn", (entityRage) => { if (entityRage.type === "player" || entityRage.type === "vehicle") { let entity; + if (entityRage.type === "player") { entity = game.players.at(entityRage.remoteId); } else if (entityRage.type === "vehicle") { entity = game.vehicles.at(entityRage.remoteId); } - let e = game.attachments.get(entity); + + if (entityRage.tye === "object") { //if is object + game.wait(200); + + mp.gui.chat.push("object streamed"); + entity = game.objects.at(entityRage.remoteId); + + game.wait(200); + mp.gui.chat.push("object try get data"); + game.wait(200); + + + const { targetEntity, bone, offset, rotation } = entity.__attachmentData; + game.wait(200); + ++ + mp.gui.chat.push(targetEntity + "," + bone + "," + offset + "," + rotation); + game.wait(200); + + + entity.attachTo( + targetEntity, bone, + offset.x, offset.y, offset.z, + rotation.x, rotation.y, rotation.z, + false, false, false, false, 2, true + ); + + + return; + } + + let e = game.attachments.get(entity); //if player or vehicle if (e != null) { if (e.__attachments) { - game.wait(5000); attachmentMngr.initFor(entityRage); } } @@ -282,7 +335,7 @@ export default function attachmentManager(game: IGame) { e.__attachmentObjects = []; } }); - + /* game.vehicles.forEach(_veh => { let vehicle = mp.vehicles.at(_veh.remoteId); @@ -304,7 +357,9 @@ export default function attachmentManager(game: IGame) { e.__attachmentObjects = []; } }); + */ } - - InitAttachmentsOnJoin(); + mp.events.add("playerReady", () => { //player finished doenloading assets from server. + InitAttachmentsOnJoin(); + }); } \ No newline at end of file diff --git a/ReallifeGamemode.Database/Models/DatabaseContext.cs b/ReallifeGamemode.Database/Models/DatabaseContext.cs index af7eca89..de58e8dd 100644 --- a/ReallifeGamemode.Database/Models/DatabaseContext.cs +++ b/ReallifeGamemode.Database/Models/DatabaseContext.cs @@ -30,7 +30,7 @@ namespace ReallifeGamemode.Database.Models optionsBuilder.UseLoggerFactory(LoggerFactory); } optionsBuilder.EnableSensitiveDataLogging(); - optionsBuilder.UseMySql("Host=localhost;Port=3306;Database=gtav-devdb;Username=gtav-dev;Password=Test123"); + optionsBuilder.UseMySql("Host=localhost;Port=3306;Database=gta-livedb;Username=gtav-live;Password=u8vbCADW--TY6iTsDycB88i&WsITj&o2"); } protected override void OnModelCreating(ModelBuilder modelBuilder) diff --git a/ReallifeGamemode.Server/Events/Disconnect.cs b/ReallifeGamemode.Server/Events/Disconnect.cs index 4f957625..bc8e23fc 100644 --- a/ReallifeGamemode.Server/Events/Disconnect.cs +++ b/ReallifeGamemode.Server/Events/Disconnect.cs @@ -53,7 +53,7 @@ namespace ReallifeGamemode.Server.Events { ChatService.BroadcastAdmin("!{#FFFF00}*** " + player.Name + " hat den Server verlassen", AdminLevel.MAPPING); } - + /* TaxiDriverJob taxiJob = JobManager.GetJob(); TaxiContract taxiContract = taxiJob.TaxiContracts.Where(t => t.Name == player.Name).FirstOrDefault(); @@ -64,6 +64,7 @@ namespace ReallifeGamemode.Server.Events taxiJob.TaxiContracts.Remove(taxiContract); } } + */ var listReports = Report.Report.listReports; ReportManage temp; for (int a = 0; a < listReports.Count; a++) diff --git a/ReallifeGamemode.Server/Events/Key.cs b/ReallifeGamemode.Server/Events/Key.cs index cbc5e9e6..32ec4e1a 100644 --- a/ReallifeGamemode.Server/Events/Key.cs +++ b/ReallifeGamemode.Server/Events/Key.cs @@ -358,12 +358,13 @@ namespace ReallifeGamemode.Server.Events using (var context = new DatabaseContext()) { + /* if (player.HasAttachment("ammobox")) { player.AddAttachment("ammobox", true); player.StopAnimation(); } - + */ bool unloadedWeaponPackage = false; List fItem = context.UserItems.Where(u => u.UserId == user.Id).ToList(); diff --git a/ReallifeGamemode.Server/Inventory/GroundItem.cs b/ReallifeGamemode.Server/Inventory/GroundItem.cs index 25f8dcb6..2737d5fc 100644 --- a/ReallifeGamemode.Server/Inventory/GroundItem.cs +++ b/ReallifeGamemode.Server/Inventory/GroundItem.cs @@ -102,7 +102,7 @@ namespace ReallifeGamemode.Server.Inventory if (!player.HasAttachment("ammobox")) { player.PlayAnimation("anim@heists@box_carry@", "idle", 49); - player.AddAttachment("ammobox", false); + //player.AddAttachment("ammobox", false); NAPI.Player.SetPlayerCurrentWeapon(player, WeaponHash.Unarmed); } } diff --git a/ReallifeGamemode.Server/Job/RefuseCollectorJob.cs b/ReallifeGamemode.Server/Job/RefuseCollectorJob.cs index 8fab42e2..80d0e5fa 100644 --- a/ReallifeGamemode.Server/Job/RefuseCollectorJob.cs +++ b/ReallifeGamemode.Server/Job/RefuseCollectorJob.cs @@ -208,7 +208,7 @@ namespace ReallifeGamemode.Server.Job Player target = data.getPartnerClient(player); if (target != null) target.TriggerEvent("MuellmannUpdateColshape", colshapeIndex); player.TriggerEvent("renderTextOnScreen", "Wirf den Müllsack in den Müllwagen."); - player.AddAttachment("binbag", false); + //player.AddAttachment("binbag", false); return; } } @@ -277,7 +277,7 @@ namespace ReallifeGamemode.Server.Job } dbContext.SaveChanges(); } - player.AddAttachment("binbag", true); + // player.AddAttachment("binbag", true); if (player.GetUser(dbContext).trashcount >= 20) { diff --git a/ReallifeGamemode.Server/Managers/PositionManager.cs b/ReallifeGamemode.Server/Managers/PositionManager.cs index 03f7bd22..7fd0aaec 100644 --- a/ReallifeGamemode.Server/Managers/PositionManager.cs +++ b/ReallifeGamemode.Server/Managers/PositionManager.cs @@ -349,7 +349,7 @@ public class BehindVehiclePoint if (!player.HasAttachment("ammobox")) { player.PlayAnimation("anim@heists@box_carry@", "idle", 49); - player.AddAttachment("ammobox", false); + //player.AddAttachment("ammobox", false); NAPI.Player.SetPlayerCurrentWeapon(player, WeaponHash.Unarmed); } } diff --git a/ReallifeGamemode.Server/Util/AttachmentSync.cs b/ReallifeGamemode.Server/Util/AttachmentSync.cs index ef3fccf8..cfa403ef 100644 --- a/ReallifeGamemode.Server/Util/AttachmentSync.cs +++ b/ReallifeGamemode.Server/Util/AttachmentSync.cs @@ -137,7 +137,7 @@ public class AttachmentSyncExample : Script player.AddAttachment(Base36Extensions.FromBase36(hash), true); } - /* [Command("xdd")] + //[Command("xdd")] public void attachment(Player player) { Vehicle veh = player.Vehicle; @@ -152,7 +152,7 @@ public class AttachmentSyncExample : Script veh.ClearAttachments(); } } - */ + }