GetPlayerConsumableNames
Jump to navigation
Jump to search
getPlayerConsumableNames
AVAILABLE FROM UPDATE 0.1.2
This function is available in G1R:MP 0.1.2 and later. The contract below includes the compatibility guarantees introduced in that update.
Returns every stable consumable inventory key exposed by the native catalog.
Syntax
table getPlayerConsumableNames()
Parameters
This function does not accept parameters.
Returns
Returns a one-based array of consumable key strings.
Examples
Build a lookup table of supported consumables:
local supported = {}
for _, itemKey in ipairs(getPlayerConsumableNames()) do
supported[itemKey] = true
end
Notes
- Available only in server-side resource scripts.
- The list includes food, drinks, potions and smoking items recognized by the current native catalog.
- A catalog entry does not by itself grant an item. Use the authoritative inventory functions provided by the gamemode.