如图上面俩车就只有一个具有完整的性能改装,另一个只能改涡轮(车辆调教是我自己写的功能,所以不受影响(没用调用GTA原生性能改装))
顺带附上改装选项检测函数以证明我为什么说它不是改车插件的问题。
function optionsShouldShow(menu)
local newOptions = {}
for i = 1, #menu.options, 1 do
local shouldShow = true
if (menu.options.modType ~= nil) then
if (GetNumVehicleModData(customVehicle, menu.options.modType) < 0) then
shouldShow = false
end
end
if (menu.options.modType == 'extras') then
if (menu.options.price ~= nil) then
menu.options.priceForSub = menu.options.price
menu.options.price = nil
end
end
if (shouldShow and menu.options.openSubMenu ~= nil) then
local subMenu = Config.Menus[menu.options.openSubMenu]
local tempShouldShow = false
for i = 1, #subMenu.options, 1 do
if (subMenu.options.modType ~= nil) then
if (GetNumVehicleModData(customVehicle, subMenu.options.modType) >= 0 or subMenu.options.openSubMenu ~= nil) then
tempShouldShow = true
break
end
end
end
shouldShow = tempShouldShow
end
if (not isOpenByAdmin) then
if (customConfigPosIndex and customConfigPosIndex > 0 and customConfigPosIndex <= #Config.Positions and Config.Positions[customConfigPosIndex] and (Config.IsUpgradesOnlyForWhitelistJobPoints == true and jobName ~= Config.Positions[customConfigPosIndex].whitelistJobName)) then
if (menu.options.openSubMenu == 'upgrade') then
shouldShow = false
end
end
end
if (shouldShow == true) then
table.insert(newOptions, menu.options)
end
end
return newOptions
end