10.09.2018, 17:47
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:
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:
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?
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.");
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];
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?