public static void SetDealerLocation(GTA.Math.Vector3 Position, float Rotation, PedHash pedHash) { Dealer Dealer = new Dealer(Position.X, Position.Y, Position.Z, Rotation, pedHash.ToString()); DealerDB.AddDealer(Dealer); UIHelper.ShowNotification("Added new dealer location"); }
internal static void SetAllDealerInventories() { Logger.Log("Settings dealer inventories"); ClearDealerInventories(); Logger.Log("Cleared Inventories"); List <Dealer> dealers = DealerDB.GetAllDealers(); Logger.Log("Loaded " + dealers.Count + " dealers"); using (var db = new LiteDatabase(GlobalVariables.DataDatabaseLocation)) { var collection = db.GetCollection <Inventory>(); List <Inventory> invs = new List <Inventory>(); foreach (Dealer dealer in dealers) { invs.Add(new Inventory(dealer.Id)); } Logger.Log("Inserting " + invs.Count + " inventories"); collection.InsertBulk(invs); } }