Lua API catalogs: Difference between revisions
Jump to navigation
Jump to search
Update Lua API navigation and catalogs |
Add player body and head catalogs |
||
| Line 7: | Line 7: | ||
|- | |- | ||
| [[Player skin catalog]] || [[setPlayerSkin]], [[setNpcSkin]] | | [[Player skin catalog]] || [[setPlayerSkin]], [[setNpcSkin]] | ||
|- | |||
| [[Player body catalog]] || [[setPlayerBody]] | |||
|- | |||
| [[Player head catalog]] || [[setPlayerHead]] | |||
|- | |- | ||
| [[Monster type catalog]] || [[spawnMonster]] | | [[Monster type catalog]] || [[spawnMonster]] | ||
Revision as of 18:58, 15 August 2026
Lua API catalogs collect stable, server-validated keys used by G1R:MP resources. Prefer catalog keys and enumeration functions over hard-coded Unreal paths.
Static catalogs
| Catalog | Used by |
|---|---|
| Player skin catalog | setPlayerSkin, setNpcSkin |
| Player body catalog | setPlayerBody |
| Player head catalog | setPlayerHead |
| Monster type catalog | spawnMonster |
Runtime catalogs
These functions return the authoritative keys supported by the running server build:
| Function | Values |
|---|---|
| getPlayerArmorNames | Armor keys |
| getPlayerWeaponNames | Melee weapon keys |
| getPlayerRangedWeaponNames | Bow and crossbow keys |
| getPlayerAmmunitionNames | Ammunition keys |
| getPlayerRuneNames | Rune and spell-item keys |
| getPlayerStatNames | Progression statistic keys |
| getPlayerSkillNames | Skill keys |
| getPlayerGuildNames | Guild keys |
Example
local function contains(values, wanted)
for _, value in ipairs(values) do
if value == wanted then
return true
end
end
return false
end
if contains(getPlayerArmorNames(), "none") then
setPlayerArmor(playerId, "none")
end