Skip to content

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.

GetPlayerHandItems(pid)
Parameter Type
pid number the player

string, string - the right hand’s item class and the left hand’s; "" for an empty hand or a player not connected

local right, left = GetPlayerHandItems(pid)
if right ~= "" and GetItemInfo(right).category == "MeleeWeapon" then
SendClientMessage(pid, COLOR_RED, "Put your blade away inside the tavern.")
end

IsPlayerWeaponDrawn · GetPlayerWeapon · GetPlayerEquipment · GetItemInfo · the Combat group of the index