Harvest question
#1

I have a question, i set maximum capacity of grams a player can carry.

So if he has already more than defined grams, he can't harvest anymore.

So i did this:

pawn Код:
if(Player[playerid][MarijuanaGrams] > MARIJUANA_MAX_CAPACITY) return SCM(playerid, COLOR_RED,"* You have reached max ammount of marijuana grams you can carry. Sell some at local DPS (/findps) first.");
My question is:

Imagine i have already 30 grams of marijuana in my inventory, and i can carry a max of 50 grams (defined in marijuana_max capacity), how i can harvest the 20 grams left and remain the rest to the plant?

This is the code which adds harvested grams to inventory and removes from the plant:

pawn Код:
Player[playerid][MarijuanaGrams] += PlantData[plantid][plantDrugs];
Lemme do an example:

I have 30 grams of marijuana, plant has 50. Limit is 50 which i can carry, i wanna harvest only 20 (30 + 20 = 50 (max capacity) and leave the remaining 30 grams (50 - 30 harvested) in the plant. How?
Reply


Messages In This Thread
Harvest question - by KinderClans - 10.09.2018, 17:47
Re: Harvest question - by Undef1ned - 10.09.2018, 23:32
Re: Harvest question - by NaS - 11.09.2018, 01:02
Re: Harvest question - by KinderClans - 11.09.2018, 07:39

Forum Jump:


Users browsing this thread: 1 Guest(s)