修改插件
-- 确保使用 exports 访问 ox_liblocal ox_lib = exports.ox_lib
-- 创建管理员菜单
local function createAdminMenu()
local menu = ox_lib.menu.create("管理员菜单")
menu:addItem("踢出玩家", function()
local playerId = ox_lib.input("请输入玩家ID", "")
if playerId then
TriggerServerEvent("admin:kickPlayer", playerId)
end
end)
menu:addItem("查看玩家信息", function()
local playerId = ox_lib.input("请输入玩家ID", "")
if playerId then
TriggerServerEvent("admin:viewPlayerInfo", playerId)
end
end)
menu:addItem("关闭菜单", function()
menu:close()
end)
return menu
end
-- 打开菜单的命令
RegisterCommand("adminmenu", function()
local menu = createAdminMenu()
menu:open()
end, false)
local menu = ox_lib.menu.create("管理员菜单")报错
页:
[1]