GetPlayerWeaponMode: Difference between revisions
Jump to navigation
Jump to search
Document new NPC/player-mode API and events available from 0.1.5 |
Release G1R:MP 0.1.5 BUILD144 / Protocol 37; update availability and migration |
||
| Line 29: | Line 29: | ||
== Notes == | == Notes == | ||
* Server-side read-only query; the player does not have an NPC resource owner. | * Server-side read-only query; the player does not have an NPC resource owner. | ||
* Since 0.1.5. | * 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. | * 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]]. | * 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]]. | ||
Latest revision as of 07:34, 26 September 2026
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.