Skip to content

Commit

Permalink
check for ability to buy weapon license
Browse files Browse the repository at this point in the history
  • Loading branch information
Flek26 committed Apr 4, 2023
1 parent d22b212 commit 9bcaf77
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions client/nui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,24 @@ end
--- Setup the items for the NUI
function NUI:SetupItems()
local items = {}
items[1] = {
name = "ID Card",
price = 100,
id = 1
}

local PlayerLicenses = QBCore.Functions.GetPlayerData().metadata["licences"]

for key = 1, #Config.items, 1 do
items[#items + 1] = {
name = Config.items[key].label,
price = Config.items[key].price,
id = key
}
for k, value in pairs(PlayerLicenses) do
if (value == true and Config.items[key].meta == k) then
items[#items + 1] = {
name = Config.items[key].label,
price = Config.items[key].price,
id = key
}
end
end
end

SendNUIMessage({
Expand Down

0 comments on commit 9bcaf77

Please sign in to comment.