Package lambda:
package iMenu:
Dumps: https://drive.google.com/file/d/1rx6...ew?usp=sharing
Code:
local menu = ImportPackage("iMenu")
AddEvent("OnKeyPress", function(key)
if key == "E" then
menu.menuCreate({
name = {
GetPackageName() .. "adminMenu"
},
options = {
align = "top-center",
title = "Mon super menu!"
},
elements = {
{
label = "Label",
type = "button",
color = "red",
classes = {"test"},
arguments = {"yay", "plop", "suuuuure!"}
}
},
onClose = function (menu)
AddPlayerChat(menu.options.align)
end,
onElementClicked = function(menu, element)
AddPlayerChat(element.label)
end
})
end
end)
Code:
function menuCreate(menuParameters)
AddPlayerChat("Menu create ok ")
-- if (GetWebVisibility(web) == WEB_VISIBLE) then
-- SetWebVisibility(web, WEB_HIDDEN)
-- SetInputMode(INPUT_GAME)
-- ShowMouseCursor(false)
-- else
-- SetWebVisibility(web, WEB_VISIBLE)
-- SetInputMode(INPUT_GAMEANDUI)
-- ShowMouseCursor(true)
-- table.insert(menus, menuParameters)
-- ExecuteWebJS(web, "createMenu(`" .. json_encode({
-- options = menuParameters.options,
-- elements = menuParameters.elements
-- }) .. "`)")
-- end
end
AddFunctionExport("menuCreate", menuCreate)

Comment