This is the most disgusting script i ever seen.
Try like this:
function onSay(cid, words, param)
if (getPlayerItemCount(cid, 17156) < 100 and getPlayerItemCount(cid, 17174) < 100) then
doPlayerSendTextMessage(cid, 20, "Precisa de 100 Apricorns vermelhos e 100 Ferros.")
else...