0

尝试索引一个 nil 值(本地“武器”)
在第一行是错误

local component = weapon.components[i]
local hasComponent = HasPedGotWeaponComponent(playerPed, GetHashKey(v.weapon), component.hash)

if hasComponent then
    label = ('%s: <span style="color:green;">%s</span>'):format(component.label, _U('armory_owned'))
else
    if v.components[i] > 0 then
        label = ('%s: <span style="color:green;">%s</span>'):format(component.label, _U('armory_item', ESX.Math.GroupDigits(v.components[i])))
    else
        label = ('%s: <span style="color:green;">%s</span>'):format(component.label, _U('armory_free'))
    end
end

1

4

0 回答 0