Jump to content
carl101

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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Just to necro a really really really old thread .....How do I fix the battleye kick for setdamage resctriction #1 when I harvest the hemp?? It goes through the motions and whenit adds the item to the inventory I get kicked for the batteye thingy. Reconnect and the item is in the inventory.

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