Simple, minimalistic event firing context menu
I really liked the look of these dark themed context menus but haven't seen alot released, now I'm sure mine isn't the best it's one of my first few public scripts and I feel it's really user friendly, I hope you all find a use for this and enjoy it!
It's pretty simple, once you drop the nh-context resource into your resources folder just make sure you put
ensure nh-context
in your server.cfg.
Syntax
TriggerEvent('nh-context:sendMenu', data, true) <-- To trigger Server Event
TriggerEvent('nh-context:sendMenu', data, false) < -- To trigger Client Event
Here is a base menu to show how it works, this is a kinda "figure it out" type of situation but I hope my examples work, the code below is what made the video above!
RegisterCommand("test", function(source, args, raw)
TriggerEvent("nh-context:testMenu")
end)
RegisterNetEvent('nh-context:testMenu', function()
TriggerEvent('nh-context:sendMenu', {
{
id = 1,
header = "Main Title",
txt = ""
},
{
id = 2,
header = "Sub Menu Button",
txt = "This goes to a sub menu",
params = {
event = "nh-context:testMenu2",
args = {
number = 1,
id = 2
}
}
},
}, false)
end)
RegisterNetEvent('nh-context:testMenu2', function(data)
local id = data.id
local number = data.number
TriggerEvent('nh-context:sendMenu', {
{
id = 1,
header = "< Go Back",
txt = "",
params = {
event = "nh-context:testMenu"
}
},
{
id = 2,
header = "Number: "..number,
txt = "ID: "..id
},
}, true)
end)
No known bugs
Feel free to report any issues you have in the GitHub Issues
if you wish to add something to it, do a pull request on the github Pull Requests