yes, once there is too many options itll allow you to scroll.
1 Like
Not Working to me, i try to copy and paste the example code, the context not showing
Hello I was wondering how to convert scripts which uses nh-context v1 version to v2? Maybe someone could help I would really appreciate it
Cant figure out how to convert from old version to new please help someone Im willing to pay for help
RegisterNetEvent('gl-prison:openGangShop',function()
if gang == nil then
getGangRep()
if nearGang == gang then
local gangShop = {}
for k, v in pairs(Config.GangShops[gang]) do
table.insert(gangShop,
{
--id = k,
header = 'Trade ' .. v.Cost .. ' ' .. v.Currency .. ' for ',
context = v.Label,
-- params = {
event = 'gl-prison:tradeForItem',
args = {
item = v.Item,
rep = v.Minrep,
cost = v.Cost
}
-- }
})
end
TriggerEvent('nh-context:createMenu', gangShop)
end
elseif nearGang == gang then
local gangShop = {}
for k, v in pairs(Config.GangShops[gang]) do
table.insert(gangShop,
{
--id = k,
header = 'Trade ' .. v.Cost .. ' ' .. v.Currency .. ' for ',
context = v.Label,
--params = {
event = 'gl-prison:tradeForItem',
args = {
item = v.Item,
rep = v.Minrep,
cost = v.Cost
}
--}
})
end
TriggerEvent('nh-context:createMenu', gangShop)
end
end)
RegisterNetEvent('gl-prison:tradeForItem',function(data)
local item = data.item
local rep = data.rep
local cost = data.cost
if gangRep >= rep then
TriggerServerEvent('gl-prison:checkTrade',item,cost)
else
exports['okokNotify']:Alert("No Way", "We ain't that cool man", 10000, 'error')
end
end)
Hello,
I just downloaded resource changed :
RegisterCommand("testcontext", function()
TriggerEvent("nh-context:testmenu") <-------- changed to testMenu
end)
when i try to trigger event nothing happens, no error nothing.
i added new option just to print something into console but it is not registering click, and any event
any idea ?
Ok i solved it, i am retarded my resource was called “nh-context-2.2.1” … renamed it to " nh-context" and it is working now.
you figured out^