Add GetResourceName function to all modules

Introduces a standardized GetResourceName function to banking, clothing, dispatch, doorlock, framework, fuel, helptext, housing, and other modules. This function returns the name of the in-use resource, improving resource identification and interoperability across the codebase.
This commit is contained in:
MrNewb committed 2025-09-10 12:27:12 -04:00
1 parent cd16291038
commit 90c65dc55e
142 files changed
+784 -25

No files matched your search

+6
View File
@@ -8,6 +8,12 @@ Inventory.GetItemInfo = function(item)
return Framework.GetItemInfo(item)
end
---This will get the name of the in use resource.
---@return string
Inventory.GetResourceName = function()
return "default"
end
---Will return boolean if the player has the item.
---@param item string
---@return boolean
+7
View File
@@ -13,6 +13,13 @@ Inventory.AddItem = function(src, item, count, slot, metadata)
return Framework.AddItem(src, item, count, slot, metadata)
end
---This will get the name of the in use resource.
---@return string
Inventory.GetResourceName = function()
return "default"
end
---This will remove an item, and return true or false based on success
---@param src number
---@param item string
@@ -21,6 +21,13 @@ Inventory.GetItemInfo = function(item)
}
end
---This will get the name of the in use resource.
---@return string
Inventory.GetResourceName = function()
return "codem-inventory"
end
---This will return the entire items table from the inventory.
---@return table
Inventory.Items = function()
@@ -18,6 +18,13 @@ Inventory.AddItem = function(src, item, count, slot, metadata)
return codem:AddItem(src, item, count, slot, metadata)
end
---This will get the name of the in use resource.
---@return string
Inventory.GetResourceName = function()
return "codem-inventory"
end
---This will remove an item, and return true or false based on success
---@param src number
---@param item string
@@ -24,6 +24,13 @@ Inventory.GetItemInfo = function(item)
return {name = dataRepack.name, label = dataRepack.label, stack = dataRepack.stack, weight = dataRepack.weight, description = dataRepack.description, image = Inventory.GetImagePath(dataRepack.name) }
end
---This will get the name of the in use resource.
---@return string
Inventory.GetResourceName = function()
return "core_inventory"
end
---This will return the entire items table from the inventory.
---@return table
Inventory.Items = function()
@@ -18,6 +18,14 @@ Inventory.AddItem = function(src, item, count, slot, metadata)
return core:addItem(src, item, count, metadata)
end
---This will get the name of the in use resource.
---@return string
Inventory.GetResourceName = function()
return "core_inventory"
end
---This will remove an item, and return true or false based on success
---@param src number
---@param item string
@@ -20,6 +20,14 @@ Inventory.GetItemInfo = function(item)
}
end
---This will get the name of the in use resource.
---@return string
Inventory.GetResourceName = function()
return "jpr-inventory"
end
---Will return boolean if the player has the item.
---@param item string
---@return boolean
@@ -19,6 +19,12 @@ Inventory.AddItem = function(src, item, count, slot, metadata)
return exports['jpr-inventory']:AddItem(src, item, count, slot, metadata, 'community_bridge Item added')
end
---This will get the name of the in use resource.
---@return string
Inventory.GetResourceName = function()
return "jpr-inventory"
end
---This will remove an item, and return true or false based on success
---@param src number
---@param item string
@@ -19,6 +19,12 @@ Inventory.GetItemInfo = function(item)
}
end
---This will get the name of the in use resource.
---@return string
Inventory.GetResourceName = function()
return "origen_inventory"
end
---This will return the entire items table from the inventory.
---@return table
Inventory.Items = function()
@@ -18,6 +18,12 @@ Inventory.AddItem = function(src, item, count, slot, metadata)
return origin:AddItem(src, item, count, metadata, slot, true)
end
---This will get the name of the in use resource.
---@return string
Inventory.GetResourceName = function()
return "origen_inventory"
end
---This will remove an item, and return true or false based on success
---@param src number
---@param item string
@@ -23,6 +23,12 @@ Inventory.GetItemInfo = function(item)
}
end
---This will get the name of the in use resource.
---@return string
Inventory.GetResourceName = function()
return "ox_inventory"
end
---This will return the entire items table from the inventory.
---@return table
Inventory.Items = function()
@@ -22,6 +22,12 @@ Inventory.AddItem = function(src, item, count, slot, metadata)
return ox_inventory:AddItem(src, item, count, metadata)
end
---This will get the name of the in use resource.
---@return string
Inventory.GetResourceName = function()
return "ox_inventory"
end
---This will remove an item, and return true or false based on success
---@param src number
---@param item string
@@ -20,6 +20,12 @@ Inventory.GetItemInfo = function(item)
}
end
---This will get the name of the in use resource.
---@return string
Inventory.GetResourceName = function()
return "ps-inventory"
end
---This will return the entire items table from the inventory.
---@return table
Inventory.Items = function()
@@ -19,6 +19,12 @@ Inventory.AddItem = function(src, item, count, slot, metadata)
return sloth:AddItem(src, item, count, slot, metadata, 'community_bridge')
end
---This will get the name of the in use resource.
---@return string
Inventory.GetResourceName = function()
return "ps-inventory"
end
---This will remove an item, and return true or false based on success
---@param src number
---@param item string
@@ -20,6 +20,12 @@ Inventory.GetItemInfo = function(item)
}
end
---This will get the name of the in use resource.
---@return string
Inventory.GetResourceName = function()
return "qb-inventory"
end
---This will return the entire items table from the inventory.
---@return table
Inventory.Items = function()
@@ -27,6 +27,12 @@ Inventory.AddItem = function(src, item, count, slot, metadata)
return qbInventory:AddItem(src, item, count, slot, metadata, 'community_bridge')
end
---This will get the name of the in use resource.
---@return string
Inventory.GetResourceName = function()
return "qb-inventory"
end
---This will remove an item, and return true or false based on success
---@param src number
---@param item string
@@ -22,6 +22,12 @@ Inventory.GetItemInfo = function(item)
}
end
---This will get the name of the in use resource.
---@return string
Inventory.GetResourceName = function()
return "qs-inventory"
end
---This will return the entire items table from the inventory.
---@return table
Inventory.Items = function()
@@ -19,6 +19,12 @@ Inventory.AddItem = function(src, item, count, slot, metadata)
return quasar:AddItem(src, item, count, slot, metadata)
end
---This will get the name of the in use resource.
---@return string
Inventory.GetResourceName = function()
return "qs-inventory"
end
---This will remove an item, and return true or false based on success
---@param src number
---@param item string
@@ -21,6 +21,12 @@ Inventory.GetItemInfo = function(item)
}
end
---This will get the name of the in use resource.
---@return string
Inventory.GetResourceName = function()
return "tgiann-inventory"
end
---Will return boolean if the player has the item.
---@param item string
---@return boolean
@@ -19,6 +19,12 @@ Inventory.AddItem = function(src, item, count, slot, metadata)
return tgiann:AddItem(src, item, count, slot, metadata, false)
end
---This will get the name of the in use resource.
---@return string
Inventory.GetResourceName = function()
return "tgiann-inventory"
end
---This will remove an item, and return true or false based on success
---@param src number
---@param item string