From 34d21c3618441335de59acaa4f8198a977b6c05c Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Sat, 18 May 2024 13:35:51 -0700 Subject: [PATCH] added autocheck for what inventory youre using to populate imgs --- client/functions.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/client/functions.lua b/client/functions.lua index 69e958b..7f5652c 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -143,4 +143,21 @@ function GetCops(number) end) end - +function GetImage(img) + if GetResourceState('ox_inventory') == 'started' then + local Items = exports['ox_inventory']:Items() + return Items[img]['client']['image'] or Items[img] + elseif GetResourceState('ps-inventory') == 'started' then + return "nui://ps-inventory/html/images/".. QBCore.Shared.Items[img].image + elseif GetResourceState('lj-inventory') == 'started' then + return "nui://lj-inventory/html/images/".. QBCore.Shared.Items[img].image + elseif GetResourceState('qb-inventory') == 'started' then + return "nui://qb-inventory/html/images/".. QBCore.Shared.Items[img].image + elseif GetResourceState('qs-inventory') == 'started' then + return "nui://qs-inventory/html/img/".. QBCore.Shared.Items[img].image + elseif GetResourceState('origen_inventory') == 'started' then + return "nui://origen_inventory/html/img/".. QBCore.Shared.Items[img].image + elseif GetResourceState('core_inventory') == 'started' then + return "nui://core_inventory/html/img/".. QBCore.Shared.Items[img].image + end +end