getPlayerSlotItem(cid, slot)
Info
This function checks what item player have actually in slot.
Slot can be:
CONST_SLOT_HEAD (1) = helmet
CONST_SLOT_NECKLACE (2) = necklace slot (amulet of loss etc.)
CONST_SLOT_BACKPACK (3) = backpack, bag
CONST_SLOT_ARMOR (4) = armor
CONST_SLOT_LEFT (5) = left hand (its really hand placed >> (right page on screen))
CONST_SLOT_RIGHT (6) = right hand (its really hand placed << (left page on screen))
CONST_SLOT_LEGS (7) = legs
CONST_SLOT_FEET (8) = boots
CONST_SLOT_RING (9) = ring slot
CONST_SLOT_AMMO (10) = ammo slot (arrows etc.)
Returns
Array with item which is actually in slot. When slot is empty, then returns false
For Example:
{itemid = 2493, uid = 70001, actionid = 0} (demon helmet, slot = 1)
Example
if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2173 then --checking if player have amulet of loss in necklace slot
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Ok, you can go.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, you need amulet of loss to go.")
doTeleportThing(cid, fromPosition, TRUE)
end