bevinart Posted January 6, 2019 Share Posted January 6, 2019 I am making a menu in C# where it will add cars based on what is on the text file. I got the file to Console.WriteLine any part I needed it too. When I went to put in vehicle spawns and submenus, the menu refuses to open inside of FiveM. I made sure that it was not messed up in resources, it loaded fine and all resources are named appropriately, it just wont open. I will provide the code I did below. Thank you… Code Below: using System; using System.Threading.Tasks; using NativeUI; using CitizenFX.Core; using System.IO; public class CarsMenu : BaseScript { //Fields MenuPool menuPool; UIMenu mainMenu; UIMenu newCategory; string[] cols; public CarsMenu() { CustomCars(); } void CustomCars() { //Adds Main Menu menuPool = new MenuPool(); mainMenu = new UIMenu("INSPRP Cars", "SELECT AN OPTION"); menuPool.Add(mainMenu); string[] lines = File.ReadAllLines(@"C:\Users\Username\Downloads\cars.txt"); foreach(string line in lines) { cols = line.Split(':'); AddCars(cols); } //Opens Menu with Z Tick += new Func<Task>(async delegate { menuPool.ProcessMenus(); if (Game.IsControlJustReleased(1, CitizenFX.Core.Control.MultiplayerInfo) && !menuPool.IsAnyMenuOpen()) { mainMenu.Visible = !mainMenu.Visible; } }); } void AddCars(string[] cols) { newCategory = menuPool.AddSubMenu(mainMenu, cols[2]); UIMenuItem newItem = new UIMenuItem(cols[1]); newCategory.AddItem(newItem); newCategory.OnItemSelect += async (sender, item, index) => { if (item == newItem) { Vehicle v = new Vehicle(0); Ped gamePed = Game.Player.Character; v = await World.CreateVehicle(cols[0], gamePed.Position, gamePed.Heading); v.PlaceOnGround(); gamePed.Task.WarpIntoVehicle(v, VehicleSeat.Driver); } }; } } Link to comment Share on other sites More sharing options...
bevinart Posted January 6, 2019 Author Share Posted January 6, 2019 Quote If you have no UIMenuItems in the MainMenu, there is nothing to display. That's not the issue, I mean that the menu is not opening, period. It is not the matter of it not displaying, its the matter of it opening what-so-ever Quote Doesn't a subMenu have to be bound to an item, or at the very least, have some method that will trigger it being displayed? I already have it so that it adds the submenu to the main menu, and it would be able to show. You are able to have a main menu of just submenus. It does not work in singleplayer as it uses a .dll file directly used for FiveM, which is using a port of NativeUI and the CitizenFX.Core.dll file. Link to comment Share on other sites More sharing options...