Jump to content
carl101

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

Share this post


Link to post
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"];
};

Share this post


Link to post
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.

Share this post


Link to post
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? 

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

Fiberplant is classed as building/vehicle so better use "deleteVehicle" if you don't want to go all jihad when harvesting.

_findHemp = nearestObjects [player,["fiberplant"],5];
deleteVehicle (_findHemp select 0);

Share this post


Link to post
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"];
};

Share this post


Link to post
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!

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...