function getTileItemCountByPos(pos, item)
local i = 0
for j = 1, 255 do
pos.stackpos = j
if getTileThingByPos(pos).itemid == item then
i = i + 1
break
end
end
return i
end
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if getTileItemCountByPos({x=1416, y=1041, z=7}, 2393) >= 3 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You can plant here.')
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'You can not plant here.')
end
return true
end