Setup
Which version do I need?
Section titled “Which version do I need?”Starting at v4.0.0 there are two versions for FiveM: Legacy and Enhanced. Legacy is for FiveM for GTA V (.NET Framework 4.5.2, CitizenFX.Core). Enhanced is for FiveM for GTA V Enhanced (.NET 10, CitizenFX.FiveM.Client). Both have the same features and the same version number.
1. Add MenuAPI to your project
Section titled “1. Add MenuAPI to your project”dotnet add package MenuAPI.FiveM.Enhanceddotnet add package MenuAPI.FiveMYour build output gets MenuAPI.dll and a menuapi folder. Don’t edit that folder, it’s replaced on every update.
2. Add the page the menu is drawn on
Section titled “2. Add the page the menu is drawn on”Menus are drawn with NUI. Create index.html next to your fxmanifest.lua:
<!DOCTYPE html><html lang="en">
<head> <meta charset="utf-8"> <title>My Resource</title> <link rel="stylesheet" href="menuapi/colour-list.min.css"> <link rel="stylesheet" href="menuapi/menuapi.min.css"></head>
<body style="margin: 0; background: transparent; overflow: hidden;">
<div id="menuapi"></div>
<script src="menuapi/sprite-cache.min.js"></script> <script src="menuapi/glare.min.js"></script> <script src="menuapi/colour-list.min.js"></script> <script src="menuapi/menuapi.min.js"></script></body>
</html>See How menus are drawn if you want to add your own things to the page.
3. Add the files to your fxmanifest
Section titled “3. Add the files to your fxmanifest”ui_page 'index.html'
files { 'MenuAPI.dll', 'index.html', 'menuapi/**/*',}If you already have a files list, add the three lines to it.
4. Make your first menu
Section titled “4. Make your first menu”using CitizenFX.FiveM.Client;using CitizenFX.FiveM.Shared.Script;using MenuAPI;
public class MyMenu : IScript{ public MyMenu() { Menu menu = new Menu("My Resource", "Main Menu"); MenuController.AddMenu(menu); menu.AddMenuItem(new MenuItem("Hello!", "My very first menu item.")); }}using CitizenFX.Core;using MenuAPI;
public class MyMenu : BaseScript{ public MyMenu() { Menu menu = new Menu("My Resource", "Main Menu"); MenuController.AddMenu(menu); menu.AddMenuItem(new MenuItem("Hello!", "My very first menu item.")); }}Press M in game to open it. Players can change that key, see Key bindings.
The API Reference has everything else. The TestMenu in the repository uses every item type.
