How can i intigrate cancarryitem?

Good day,
I have a farm that was originally for Limit, but since I have es_extended 1.2, I use weight. Now I have changed limit to weight, but it does not work because you have to write cancarryitemum, but I do not know exactly how to do that. I have tried it a few times but without success.

This is my code that needs to be changed:

–collector
local function HarvestKoda(source)

SetTimeout(Config.TimeToFarm, function()
	if PlayersHarvestingKoda[source] then
		local xPlayer = ESX.GetPlayerFromId(source)
		local koda = xPlayer.getInventoryItem('apple')

		if koda.limit ~= -1 and koda.count >= koda.limit then
			TriggerClientEvent('esx:showNotification', source, _U('bag_full'))
		else
			xPlayer.addInventoryItem('apple', 2)
			HarvestKoda(source)
		end
	end
end)

end

can you help me?

many greetings