Jump to content

Cherno hemp farm


Recommended Posts

hi guys, just a quick hemp farm i chucked together that would go great with a few AI once i work out how to harvest them....

The pics don't really do it justice, looks better up close

pics https://imgur.com/a/BwrxS

mission.sqf http://pastebin.com/Rnshk8sg

beidi http://pastebin.com/Ck1Jbam3

if anyone knows how to make this stuff harvestable then please let us know

Link to comment
Share on other sites

If anybody want it,

i use macca´s righ click option to harvest the hemp,

looks like this:

class ExtraRc {
	class ItemMachete {
		class farmhemp {
			text = "Harvest hemp";
			script = "execVM 'scripts\hemp.sqf'";
		};
	};
};

Ive put the hemp.sql in my mpmission scripts folder.

the hemp script:

_countHemp = count nearestObjects [player, ["fiberplant"], 5];

if (_countHemp > 0) then {
cutText [format["Start harvesting....."], "PLAIN DOWN"];
player removeWeapon "ItemMachete";
player playActionNow "Medic";
sleep 5;
player addMagazine "ItemKiloHemp";
player addWeapon "ItemMachete";
cutText [format["Finished harvesting! , 2 kilo hemp has been added in your inventory!"], "PLAIN DOWN"];
} else {
cutText [format["You are not close enough to a hemp plant!"], "PLAIN DOWN"];
};
Link to comment
Share on other sites

Could you use something like.

Nearestobjects [player, ["fiberplant"]] setdamage _object = 1

Im not that great at coding and I am literally writing this with one eye open but it should be somehwere along thos lines. obviously with more integrity checking to make sure its within a certain distance but i think you get the idea.

I would like to see what someone does with this.

Link to comment
Share on other sites

 Tried this:

_countHemp = count nearestObjects [player, ["fiberplant"], 5];
_Hemp = nearestObjects [player, ["fiberplant"], 5];
if (_countHemp > 0) then {
cutText [format["Start harvesting....."], "PLAIN DOWN"];
player removeWeapon "ItemMachete";
player playActionNow "Medic";
sleep 5;
player addMagazine "ItemKiloHemp";
player addWeapon "ItemMachete";
cutText [format["Finished harvesting! A kilo of hemp has been added to your inventory!"], "PLAIN DOWN"];
			sleep 1;
			_Hemp setDamage 1;
			};
} else {
cutText [format["You are not close enough to a hemp plant!"], "PLAIN DOWN"];
};

Harvest works fine, but again no damage.  So, out of curiosity I  dropped a bunch of explosives.  Everything except the fiberplants was destroyed.  So, somehow the fiberplants are being spawned in an indestructible state.  Any way to override that? 

Link to comment
Share on other sites

Got a problem with this script. Players can Click Harvest repeatedly and fill their inventory up with 1200 KiLOs of Hemp. Going to have to take it out of my server until I can or someone else posts a fix. Anyone else have this issue?

 

You could set a limit to how many hemps can be in the main inventory at once.

_hempqty = {_x == "ItemKiloHemp"} count magazines player;

if (_hempqty > 9) exitWith { 
    cutText [format["WARNING: %1, You have maximum amount of weed in your inventory!", name player], "PLAIN DOWN"];
};
Link to comment
Share on other sites

 

You could set a limit to how many hemps can be in the main inventory at once.

_hempqty = {_x == "ItemKiloHemp"} count magazines player;

if (_hempqty > 9) exitWith { 
    cutText [format["WARNING: %1, You have maximum amount of weed in your inventory!", name player], "PLAIN DOWN"];
};

Excellent! Where does this go in the SQF? Thank you so much for your help!

Link to comment
Share on other sites

Excellent! Where does this go in the SQF? Thank you so much for your help!

 

Ok. Thanks for the help. Doesn't help unfortuantely. They can still spam the Harvest Hemp button repeatedly, even though the machete has left their inventory the Option still shows as long as they keep clicking Harvest Hemp. I have tried so many different Else and If statements. gonna try to make this a scroll wheel option. Will update if I get a solution. :)

 

Zero

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...