GetPlayerWeaponMode

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 17:14, 25 September 2026 by QCherry (talk | contribs) (Document new NPC/player-mode API and events available from 0.1.5)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

getPlayerWeaponMode

AVAILABLE FROM UPDATE 0.1.5
This function is available in G1R:MP 0.1.5 and later. The contract below includes the compatibility guarantees introduced in that update.

Reads the currently observed drawn weapon mode of a player.

Syntax

getPlayerWeaponMode(playerId)

Parameters

Name Type Required Description
playerId int yes Connected player ID.

Returns

Returns none, fist, melee, bow, crossbow or magic; false when the ID/state is unavailable.

Examples

local mode = getPlayerWeaponMode(playerId)

Notes

  • Server-side read-only query; the player does not have an NPC resource owner.
  • Since 0.1.5. This documents the next release; public 0.1.4 does not include these additions.
  • Use matching updated client and server. See NPC scripting for lifecycle, defaults, combat examples and collision limitations.
  • This reads validated equipment/spell observation, not inventory slots. First observation establishes a baseline. Dead/downed players resolve to none; unavailable observations return false. See onPlayerWeaponModeChange.