GetPlayerWeaponMode

From Wiki G1R-MP G1 Remake Multiplayer
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. Use the matching 0.1.5 client and server (Protocol 37).
  • 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.