Respown
Gold Elite
Hello guys,
His action:
Selecting script from F8 > nui_devtools > js section, np-menu throws the post request below.
$.post('
I thought that I should bring a limitation to this in addition to the tool in a single line.
np-menu > client_menu.lua > find triggerAction nui callback it will look like below.
Code:
Change it as follows so it won't work with any triggers that are not allowed in the config.
Code:
His action:
Selecting script from F8 > nui_devtools > js section, np-menu throws the post request below.
$.post('
Hidden link for visitors, to see
Log in or register now.
', JSON.stringify({action: "esx:spawnVehicle", parameters: "drafter"}));I thought that I should bring a limitation to this in addition to the tool in a single line.
np-menu > client_menu.lua > find triggerAction nui callback it will look like below.
Code:
Code:
-- Callback function for when a slice is clicked, execute command
RegisterNUICallback('triggerAction', function(data, cb)
showMenu = false
SetNuiFocus(false, false)
SendNUIMessage({
state = 'destroy'
})
PlaySoundFrontend(-1, "NAV", "HUD_AMMO_SHOP_SOUNDSET", 1)
TriggerEvent(data.action, data.parameters)
cb('ok')
end)
Change it as follows so it won't work with any triggers that are not allowed in the config.
Code:
Code:
RegisterNUICallback('triggerAction', function(data, cb)
showMenu = false
SetNuiFocus(false, false)
SendNUIMessage({
state = 'destroy'
})
PlaySoundFrontend(-1, "NAV", "HUD_AMMO_SHOP_SOUNDSET", 1)
local result = false
for key,value in pairs(newSubMenus) do
if value.functionName == data.action then
result = true
break
end
end
if result then
TriggerEvent(data.action, data.parameters)
end
cb('ok')
end)