[Standalone] NeroHiro’s Context Menu v2 - Now for RedM & FiveM

LY0d

I decided to reopen my support for my context menu, it now supports both FiveM and RedM!

I changed the formatting to auto assign the id, and adjusted the way the arguments pass, along with allowing images to show on hover, and passing the event to a server event if you want!

It’s very simple to use, minimalistic, and allows to build powerful context menus in very little time.

This goes almost hand in hand with my keyboard script
nh-keyboard

Pretty simple to use, you can build a menu using the main event and include menu options in a table and the js will do the rest for you, you can pass events with arguments! If you need examples check the readme on the github.

You can also pass the function instead if you want an asynchronous option :smiley:

Download
NH-Context v2.2

In this update I added a few new QOL features including:

* Added a disabled boolean to change a button to be unable to be pressed, along with changing the color of the button
* added a subMenu boolean to show a right arrow pointing to signify this button accesses a submenu
* added a footer string variable to have another line of text at the bottom of your button

If you need instructions on installation/use just read the Readme on the github!

Enjoy!

19 Likes

Small update (already? yea I know) I updated passing arguements to a simple packing/unpacking system so on event firing it will unpack your args so you don’t have to specify data.arg1, data.arg2 , data.arg3 etc. instead you can pass it in the function for the event I.E. function(arg1, arg2, arg3) etc.

4 Likes

Welcome back!!!

1 Like

I’m glad you decided to reopen this, its one of those resources that changes the game for most people. You’re an awesome dude :+1:

1 Like

Hey man, im confused am I doing something wrong I cant figure it out but when I add in your test function I get this

edit : I know it says the issue but when I add what its looking for it still wont work

the script doesn’t even go to line 141, so it’s whatever you are adding. show the snippet and ill tell you how to fix it.

I have added the read me code and then I get the error, I appreciate the quick response

you are missing a comma after header,

you also should update, i removed the need to specify the object in the table

:man_facepalming: How did I not notice the comma, my bad man :laughing:

This is amazing welcome back !!

1 Like

btw i got an issue and when i open the menu it looks like this image

updated the video showcase to show me using it to make an outfit menu in redm!

show the code snippet ur using to open that

i used this one

local accept = exports["nh-context"]:ContextMenu({
    {
        header = "Pick One",
    },
    {
        header = "Number: " .. number,
        context = "ID: " .. id
        returnValue = "1"
    },
    {
        header = "Number: " .. number,
        context = "ID: " .. id
        returnValue = "2"
    },
})
if accept ~= nil then
    if accept == "1" then
        -- do something
    elseif accept == "2" then
        -- do something else
    end
end

i just tested this exact cost with a few minor adjustments to account for the number and id and it worked fine, u sure u loaded the ui properly?

Yea same problem here, for some reason the CSS is not loading

did you edit the files at all?

Nope, just downloaded and started the resource

1 Like

Having the same issue here. I didn’t edit the files.

@NeroHiro Found the problem, maybe you uploaded wrong CSS file with V2.1, because there is no button class nor txt ?