Usage
IMenu Interface
name
string - Menu entry name to show
icon?
string - Icon to show (should use from fontawesome)
eventName?
string - Event name to trigger
args?
any - Event argumentums
env?
"server" | "client" - Which environment trigger the event?
description?
string - Menu entry description
Clientside
Open
atCursor?
boolean
Open menu at cursor coordinates
exports["avp_click_menu"]:open(atCursor)
Close
exports["avp_click_menu"]:close()
SetData
---@param menuHeader string
---@param menuData IMenu[]
exports["avp_click_menu"]:setData(menuHeader, menuData)
Serverside
Open
exports["avp_click_menu"]:open(source, atCursor)
Close
exports["avp_click_menu"]:close(source)
SetData
---@param source number | string
---@param menuHeader string
---@param menuData IMenu[]
exports["avp_click_menu"]:setData(source, menuHeader, menuData)
Examples
Serverside
RegisterNetEvent("Ping", function(response)
local source = source
print(source .. " " .. response)
end)
RegisterCommand("sv_test", function(source)
exports["avp_click_menu"]:setData(
source,
"Vehicle (Server)",
{
{
icon = "fa-solid fa-car",
name = "Open door",
eventName = "Ping",
env = "server",
args = "Pong",
description = "Description (server)"
}
}
)
exports["avp_click_menu"]:open(source)
end)
Clientside
AddEventHandler("Ping", function(response)
print(response) -- Pong
end)
RegisterCommand("cl_test", function()
exports["avp_click_menu"]:setData(
"Vehicle (Client)",
{
{
icon = "fa-solid fa-car",
name = "Open door",
eventName = "Ping",
env = "client",
args = "Pong",
description = "Description (client)"
}
}
)
exports["avp_click_menu"]:open(true)
end)