Jump to content

Cherno hemp farm


Recommended Posts

Had this put together before finding the "fiberplant" object. Was using a different object to gather hemp. This will close the gear menu to prevent spamming. Only exploit I know of is that players can open gear while in a vehicle and not have to sit through the animation, so they can quickly reopen their gear back up. However, on my Chernarus servers, they can't get vehicles in the area so I didn't put in a restriction for it. I use Maca's extraRC but for a knife instead of a machete. I realize I have both the "call server_deleteObj" and "setdamage 1;". Just want to make sure players do not have an unlimited supply. The "call server_deleteObj" will make the object disappear for everyone, whereas "setdamage 1" is like a coin flip if it does or not. 

/*
put together for DayZ Insurrection Epoch servers
modified for separate "gather weed" script
*/

private ["_gearmenu","_playerPos","_nearWeed","_weed","_objectID","_objectUID"];
_playerPos = getPosATL player;
_nearWeed = count nearestObjects [_playerPos, ["fiberplant"], 4] > 0;
_weed = nearestObject [player, "fiberplant"];

if !(_nearWeed) exitWith {
	cutText [format["You need to be near the weed plants in order to gather."], "PLAIN DOWN"];
};

if (dayz_combat == 1) then { 
    cutText [format["You are in Combat and Cannot Gather Weed."], "PLAIN DOWN"];
} else {
	disableSerialization;
	_gearmenu = FindDisplay 106;
	_gearmenu CloseDisplay 106;
	player playActionNow "Medic";
	r_interrupt = false;
	sleep 6;
	_objectID = _weed getVariable["ObjectID","0"];
	_objectUID = _weed getVariable["ObjectUID","0"];
	deleteVehicle _weed;
	[_objectID,_objectUID] call server_deleteObj;
	_weed setDamage 1;
	player addMagazine "ItemKiloHemp";
	sleep 2;
	cutText [format["You've Gathered Some Weed! Smoke that shit or sell it!"], "PLAIN DOWN"];	
};
Link to comment
Share on other sites

 

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

_findHemp = nearestObjects [player,["fiberplant"],5];
_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"];
};
 
if (_countHemp > 0) then {
cutText [format["Start harvesting....."], "PLAIN DOWN"];
player removeWeapon "ItemMachete";
player playActionNow "Medic";
sleep 5;
player addMagazine "ItemKiloHemp";
player addWeapon "ItemMachete";
deleteVehicle (_findHemp select 0);
cutText [format["Finished harvesting! , Sell at Bandit Trader or SMOKE IT!;)"], "PLAIN DOWN"];
} else {
cutText [format["You are not close enough to a hemp plant!"], "PLAIN DOWN"];
};

I'm using this and it works great. The hemp plants get removed and can not be harvested again =D

~Genesis

Link to comment
Share on other sites

@ Shogun and Genisis

This works awesome guys! Thank You So Much!!!!!!!!!!!!!!!!!!!!!!!!!

 

Zero

 

:huh:  That's exactly what I just posted and you said it doesn't work... well whatever but add "closeDialog 0;" on the top to close GUI.

Link to comment
Share on other sites

  • 3 weeks later...
  • 6 months later...
  • 2 weeks later...

can someone please provide a full detailed version on how to get this to work. Im having an issue with harvesting.

 

On many servers I play you just need to stand next to the plant, open inventory and right-click the knife (Harvest Plant)

 

A little bit of research on here would have brought you to my tutorial on how to do it.

Also includes some other goodies :3

Link to comment
Share on other sites

  • 2 years later...

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...