GetPlayerHandItems
What a player holds in their hands right now.
The item classes (GUIDs) in the player’s right and left hand as their game last said - a drawn sword and a shield, a bow
and its arrow, a hammer and tongs at the anvil; "" for an empty hand. This is what they hold, where
GetPlayerEquipment is everything they wear and carry in their slots, sheathed or not. It follows a draw, a switch or a
holster within a fraction of a second. A lit torch is not counted. GetItemInfo turns a class into its catalogue entry.
Syntax
Section titled “Syntax”GetPlayerHandItems(pid)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
Returns
Section titled “Returns”string, string - the right hand’s item class and the left hand’s; "" for an empty hand or a player not connected
Example
Section titled “Example”local right, left = GetPlayerHandItems(pid)if right ~= "" and GetItemInfo(right).category == "MeleeWeapon" then SendClientMessage(pid, COLOR_RED, "Put your blade away inside the tavern.")endSee also
Section titled “See also”IsPlayerWeaponDrawn · GetPlayerWeapon · GetPlayerEquipment · GetItemInfo · the Combat group of the index
