GetPlayerConsumableNames: Difference between revisions
Jump to navigation
Jump to search
Document Lua functions planned for G1R:MP update 0.1.2 |
Document Lua APIs available or improved from G1R:MP 0.1.2 |
||
| Line 1: | Line 1: | ||
= getPlayerConsumableNames = | = getPlayerConsumableNames = | ||
<div style="background:# | <div style="background:#fff5f5; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#111111; padding:0.85rem 1rem; margin:0.75rem 0 1rem;"> | ||
<div style="color:# | <div style="color:#111111; font-weight:bold; letter-spacing:0.04em;">AVAILABLE FROM UPDATE 0.1.2</div> | ||
<div style="color:# | <div style="color:#111111; margin-top:0.25rem;">This function is available in G1R:MP 0.1.2 and later. The contract below includes the compatibility guarantees introduced in that update.</div> | ||
</div> | </div> | ||
Latest revision as of 18:39, 3 September 2026
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.