I Will post the script here. Menu is supposed to be a test, for further editing, modificating etc, etc. Nothing happens when the bind is pressed (M).
using CitizenFX.Core;
using CitizenFX.Core.Native;
using CitizenFX.Core.UI;
using NativeUI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace menu
{
public class menu : BaseScript
{
MenuPool menupool;
UIMenu mainMenu;
public menu()
{
EventHandlers["onPlayerJoining"] += new Action<dynamic, dynamic>(OnPlayerJoining);
Tick += onTick;
}
public async Task onTick()
{
await Task.Delay(0);
if (Game.IsControlJustReleased(0, Control.InteractionMenu))
mainMenu.Visible = !mainMenu.Visible;
}
void OnPlayerJoining(dynamic arg1, dynamic arg2)
{
menupool = new MenuPool();
mainMenu = new UIMenu("test", "select");
mainMenu.MouseControlsEnabled = false;
menupool.Add(mainMenu);
menupool.RefreshIndex();
}
}
}