WarOfTheTitans
Active Member
- Joined
- Feb 3, 2012
- Messages
- 430
- Reaction score
- 37
How to check if the player has a shield equipped? I've searched everything and I haven't found anything.
This was what I come up with, but if the player has a empty slot, errors occurs:
Thank and rep+
This was what I come up with, but if the player has a empty slot, errors occurs:
Lua:
function getPlayerShieldEquipped(cid)
local slotRight = getPlayerSlotItem(cid, CONST_SLOT_RIGHT).uid
local slotLeft = getPlayerSlotItem(cid, CONST_SLOT_LEFT).uid
if(getItemWeaponType(slotRight) == WEAPON_SHIELD or getItemWeaponType(slotLeft) == WEAPON_SHIELD) then
return true
end
end
Thank and rep+