Qs-inventory and Framework IsPlayerDead fixes
qs item info had typo. IsPlayerDead was missing last stand for qb also removed couple debug prints
This commit is contained in:
1 parent
486dca3eb7
commit
3cb9829f4f
5 files changed
+9
-8
No files matched your search
@@ -257,7 +257,7 @@ Framework.GetIsPlayerDead = function(src)
|
|||||||
local player = QBCore.Functions.GetPlayer(src)
|
local player = QBCore.Functions.GetPlayer(src)
|
||||||
if not player then return end
|
if not player then return end
|
||||||
local playerData = player.PlayerData
|
local playerData = player.PlayerData
|
||||||
return playerData.metadata.isdead or false
|
return playerData.metadata.isdead or playerData.metadata.inlaststand or false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ Inventory.GetPlayerInventory = function(src)
|
|||||||
local playerItems = origen_inventory:GetInventory(src)
|
local playerItems = origen_inventory:GetInventory(src)
|
||||||
local repackedTable = {}
|
local repackedTable = {}
|
||||||
for _, v in pairs(playerItems.inventory) do
|
for _, v in pairs(playerItems.inventory) do
|
||||||
print(json.encode(v, { indent = true }))
|
|
||||||
table.insert(repackedTable, {
|
table.insert(repackedTable, {
|
||||||
name = v.name,
|
name = v.name,
|
||||||
count = v.count,
|
count = v.count,
|
||||||
|
|||||||
@@ -150,7 +150,6 @@ end
|
|||||||
---@return string
|
---@return string
|
||||||
Inventory.GetImagePath = function(item)
|
Inventory.GetImagePath = function(item)
|
||||||
item = Inventory.StripPNG(item)
|
item = Inventory.StripPNG(item)
|
||||||
print(item)
|
|
||||||
local file = LoadResourceFile("ox_inventory", string.format("web/images/%s.png", item))
|
local file = LoadResourceFile("ox_inventory", string.format("web/images/%s.png", item))
|
||||||
local imagePath = file and string.format("nui://ox_inventory/web/images/%s.png", item)
|
local imagePath = file and string.format("nui://ox_inventory/web/images/%s.png", item)
|
||||||
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
|
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
if GetResourceState('qs-inventory') ~= 'started' then return end
|
if GetResourceState('qs-inventory') ~= 'started' then return end
|
||||||
local quasar = exports["qs-inventory"]
|
local quasar = exports["qs-inventory"]
|
||||||
|
|
||||||
Inventory = Inventory or {}
|
Inventory = Inventory or {}
|
||||||
|
|
||||||
---comment
|
---comment
|
||||||
@@ -14,8 +13,10 @@ end
|
|||||||
---@param item string
|
---@param item string
|
||||||
---@return table
|
---@return table
|
||||||
Inventory.GetItemInfo = function(item)
|
Inventory.GetItemInfo = function(item)
|
||||||
local itemData = quasar:GetItemList()
|
local itemsData = quasar:GetItemList()
|
||||||
if not itemData[item] then return {} end
|
if not itemsData then return {} end
|
||||||
|
local itemData = itemsData[item]
|
||||||
|
if not itemData then return {} end
|
||||||
local repackedTable = {
|
local repackedTable = {
|
||||||
name = itemData.name or "Missing Name",
|
name = itemData.name or "Missing Name",
|
||||||
label = itemData.label or "Missing Label",
|
label = itemData.label or "Missing Label",
|
||||||
|
|||||||
@@ -127,8 +127,10 @@ end
|
|||||||
---@param item string
|
---@param item string
|
||||||
---@return table
|
---@return table
|
||||||
Inventory.GetItemInfo = function(item)
|
Inventory.GetItemInfo = function(item)
|
||||||
local itemData = quasar:GetItemList()
|
local itemsData = quasar:GetItemList()
|
||||||
if not itemData[item] then return {} end
|
if not itemsData then return {} end
|
||||||
|
local itemData = itemsData[item]
|
||||||
|
if not itemData then return {} end
|
||||||
local repackedTable = {
|
local repackedTable = {
|
||||||
name = itemData.name or "Missing Name",
|
name = itemData.name or "Missing Name",
|
||||||
label = itemData.label or "Missing Label",
|
label = itemData.label or "Missing Label",
|
||||||
|
|||||||
Reference in new issue
Block a user