Jump to content
juandayz

[1.6 Harvestable hemp, smoking weed, pot farms]

Recommended Posts

DRUGS

Before star... you should add this items into your traders menus.

Spoiler

equip_comfreyleafs  (used to craft drugs plants)

ItemFertilizer (used to craft drugs plants)

ItemHempPlant (the hemp plant who comes by default with epoch)

ItemKiloHemp (the thing we gonna use to set as drug)

1.Create this path: mpmissions\your instance\scripts\drugs\

2-Create the sqfs into the new path.

Spoiler

craftplant.sqf

Spoiler

//by juandayz
private ["_seeds","_ItemFertilizer"];
_seeds = {_x == "equip_comfreyleafs"} count magazines player;
if (_seeds < 2) exitWith {systemchat"you need  2 leafs";};

_ItemFertilizer = {_x == "ItemFertilizer"} count magazines player;
if (_ItemFertilizer == 0) exitWith {systemchat"you need  fertilezer";};

player playActionNow "Medic";
player removeMagazine "ItemFertilizer";
player removeMagazine "equip_comfreyleafs";
player removeMagazine "equip_comfreyleafs";
sleep 1;
player addMagazine "ItemHempPlant";

systemchat "you got a weed plant";

 

cutehemp.sqf

Spoiler

/*
rewrited by juandayz for epoch 1.6
put together for DayZ Epoch
Credits to Shogun338 from Insurrection gaming
modified for separate "gather weed" script
*/

private ["_weed2","_vehicle","_inVehicle","_countplayers","_gearmenu","_playerPos","_nearWeed","_weed","_objectID","_objectUID","_hempqty"];
_playerPos = getPosATL player;
_hempqty = {_x == "ItemKiloHemp"} count magazines player;
_nearWeed = count nearestObjects [_playerPos, ["fiberplant","MAP_c_fern"], 4] > 0;
_weed = nearestObject [player,"fiberplant"];

_weed2 = nearestObject [player,"MAP_c_fern"];

if !(_nearWeed) exitWith {
 systemChat("Needs be near of a plant");
};
if (_hempqty > 12) exitWith {
    systemChat("Youre Full of Drugs");
};

_vehicle = vehicle player;
_inVehicle = (_vehicle != player);
_countplayers = count nearestObjects [player, ["CAManBase"], 7];
if (_inVehicle) exitWith {
 systemChat("you cannot do it in a vehicle");
 };
if (_countplayers > 1) exitWith {

  systemChat("Nearest player action cancelled");
 };

    disableSerialization;
    _gearmenu = FindDisplay 106;
    _gearmenu CloseDisplay 106;
    player playActionNow "Medic";
    r_interrupt = false;
    sleep 6;
    deleteVehicle _weed;
    deleteVehicle _weed2;
    player addMagazine "ItemKiloHemp";
    sleep 2;
     systemChat("NICE LETS SMOKE IT");

 

smoke.sqf

Spoiler

/*
 rewrited by juandayz for epoch 1.6
   credits to ZeroK00L...
*/
    [] spawn {
    systemChat("Drugs my only love");
    player removeMagazine 'ItemKiloHemp';
    Remove_Drug_effects =
    {
    {
    ppEffectDestroy _x;
    } forEach (_this select 0);
    ppEffectDestroy ppe2;
    ppEffectDestroy ppe3;
    setaperture 0;
    };
    _time = time;
    _effects = [];
	player playMoveNow "ActsPercMstpSnonWpstDnon_sceneBardak01";
    while {true} do
    {
    ppe2 = ppEffectCreate ["chromAberration", 1555];
    _effects = _effects + [ppe2];
    ppe2 ppEffectAdjust [random 0.25,random 0.25,true];
    ppe2 ppEffectCommit 1;
    ppe2 ppEffectEnable true;
    ppe3 = ppEffectCreate ["radialBlur", 1555];
    _effects = _effects + [ppe3];
    ppe3 ppEffectEnable true;
    ppe3 ppEffectAdjust [random 0.02,random 0.02,0.15,0.15];
    ppe3 ppEffectCommit 1;
    sleep random(1);
    if (_time + 10 < time) exitWith {[_effects] call Remove_Drug_effects;};
    };
    };

 

 

3.Now you need extra_rc.hpp or deploy anything mod.

Spoiler

if your using extra_rc.hpp paste:

Spoiler

class ExtraRc {
 /////////////////////////////DRUGS
 class ItemKnife {
        class farmhemp {
            text = "HARVEST PLANT";
            script = "execVM 'scripts\drugs\cuthemp.sqf'";
        };
		
    };
    class ItemKiloHemp {
        class smokeweed {
            text = "SMOKE ME!!!";
            script = "execVM 'scripts\drugs\smoke.sqf'";
        };
    };
    class ItemMachete {
        class farmhemp2 {
            text = "HARVEST PLANT";
            script = "execVM 'scripts\drugs\cuthemp.sqf'";
        };
    };	
	class equip_comfreyleafs {
        class create {
            text = "WeedPlant";
            script = "execVM 'scripts\drugs\craftplant.sqf'";
        };
    };
///////////////END DRUGS
};

 

 

if ure using deploy anything

DZE_CLICK_ACTIONS = [
///DRUGS
["ItemKnife","Harvest the weed","execVM 'scripts\drugs\cuthemp.sqf';","true"],
["ItemMachete","Harvest the weed","execVM 'scripts\drugs\cuthemp.sqf';","true"],
["equip_comfreyleafs","CraftPlant","execVM 'scripts\drugs\craftplant.sqf';","true"],
["ItemKiloHemp","Smoke that shit","execVM 'scripts\drugs\smoke.sqf';","true"]
//DRUGS ENDS
];

 

 

4.Now we gonna create an epoch event to spawn weed fields.

Spoiler

A-Open init.sqf

this line must be true:

EpochUseEvents = true;

and add lines in blue:

EpochEvents = [["any","any","any","any",10,"server_weed"],["any","any","any","any",13,"default epoch events"]];

B-into dayz_server\modules\ create server_weed.sqf

Spoiler

//taked from nova
private ["_hintmsg","_spawnChance", "_spawnMarker", "_spawnRadius", "_markerRadius", "_item", "_debug", "_start_time", "_loot", "_loot_amount", "_loot_box", "_wait_time", "_spawnRoll", "_position", "_event_marker", "_loot_pos", "_debug_marker","_loot_box", "_hint"];
_hintmsg = false; //change by true if ure using remotemessages provided by coins mod
_spawnChance =  1; // Percentage chance of event happening 0.30
_markerRadius = 300; // Radius the loot can spawn and used for the marker
_debug = true; // Puts a marker exactly were the loot spawns

_wait_time = 800; 

// Dont mess with theses unless u know what yours doing
_start_time = time;
_spawnRadius = 5000;
_spawnMarker = 'center';

// Random chance of event happening
_spawnRoll = random 1;
if (_spawnRoll > _spawnChance and !_debug) exitWith {};

// Random location [[x,y,z],0,1000,10,0,25,0] call BIS_fnc_findSafePos;
_position = [getMarkerPos _spawnMarker,0,_spawnRadius,10,0,4000,0] call BIS_fnc_findSafePos;

diag_log(format["Spawning loot event at %1", _position]);

_event_marker = createMarker [ format ["loot_event_marker_%1", _start_time], _position];
_event_marker setMarkerShape "Ellipse";
_event_marker setMarkerColor "ColorGreen";
_event_marker setMarkerAlpha 0.5;
_event_marker setMarkerBrush "GRID";
_event_marker setMarkerSize [_markerRadius, _markerRadius];
//
_event_markerLabel = createMarker [ format ["loot_event_marker_%1", _start_time], _position];
_event_markerLabel setMarkerColor "ColorBlack";
_event_markerLabel setMarkerText "Hemp Field";




_loot_pos = [_position,0,(_markerRadius - 100),10,0,2000,0] call BIS_fnc_findSafePos;

if (_debug) then {
	_debug_marker = createMarker [ format ["loot_event_debug_marker_%1", _start_time], _loot_pos];
	_debug_marker setMarkerType "Join";
	_debug_marker setMarkerColor "ColorGreen";
	_debug_marker setMarkerAlpha 1;
};

diag_log(format["Creating ammo box at %1", _loot_pos]);

_buildPlant = random 30;
_offset = 120;

for "_i" from 0 to _buildPlant do {

    _distance1 = random _offset;
    _distance2 = random _offset;

    _plant = createVehicle ["Fiberplant", [(_loot_pos select 0)+_distance1,(_loot_pos select 1)+_distance2, 0], [], 0, "CAN_COLLIDE"];
    _plant setPos [(_loot_pos select 0)+_distance1,(_loot_pos select 1)+_distance2, 0];
    _uID = str(round(random 999999));
    _plant setVariable ["ObjectID", _uID, true];
    _plant setVariable ["ObjectUID", _uID, true];
    _plant setVariable ["lastUpdate",time,true];

};

if (_hintmsg) then {
// Send message to users
_hint = parseText format["<t align='center' color='#31db3c' shadow='2' size='1.55'>NEW EVENT</t><br/><t align='center' color='#ffffff'>!WEED FIELD!.Take your Knife or Machete and harvest some drugs.</t>"];
RemoteMessage = ['hint', _hint];
publicVariable "RemoteMessage";
}else{
[nil,nil,rTitleText,"A WEED FIELD!","PLAIN",7.5] call RE;    
};


diag_log(format["Loot event setup, waiting for %1 seconds", _wait_time]);

// Wait
sleep _wait_time;

// Clean up
// deleteVehicle _loot_box;
deleteMarker _event_marker;
deleteMarker _event_markerLabel;

if (_debug) then {
	deleteMarker _debug_marker;
};

 

 

Now this is optional... since i do not use road blocks for anything... i just change it by weed plants.. so if u wanna do the same:

1-Open spawn_roadblocks.sqf located in dayz_server\compile\

then change this line:

_spawnveh = DZE_isWreck call BIS_fnc_selectRandom;

by:

_spawnveh = "Fiberplant";

2-open your init.sqf find this line to manage the amount of fiber plants spawned.

MaxDynamicDebris = 20; // was changed by juandayz to spawn fiberplants

 

Optional too. Create a police Drugs check point. (if player cross that check point with drugs police gonna remove it)

You will need create the map addon.. i just give you the code for remove drugs.

Spoiler

police.sqf

[format["<t size='1.2' color='#D01000'>WARNING %1</t><br/><t size='0.9'>POLICE GONNA REMOVE ALL YOUR DRUGS FROM YOUR INVENTORY</t>",(name player)],0,0,5,5] spawn BIS_fnc_dynamicText;
while {true} do {
		private["_vehicle", "_curspeed", "_vel", "_dir", "_speed","_hempqty"];
        //waitUntil {vehicle player != player and!((vehicle player) isKindOf 'Air')};
		
		if (vehicle player != player and!((vehicle player) isKindOf 'Air')) then {
        _vehicle = vehicle player;
        _curspeed = speed _vehicle;
        if (_curspeed > 30) then {
            _vel = velocity _vehicle;
            _dir = direction _vehicle;
            _speed = _curspeed - 30;
            _vehicle setVelocity[(_vel select 0) - ((sin _dir) * _speed), (_vel select 1) - ((cos _dir) * _speed), (_vel select 2)];
        };
		_hempqty = {_x == "ItemKiloHemp"} count magazines player;
		if (_hempqty > 0) exitWith{
		{player removeMagazine "ItemKiloHemp"} count (magazines player);
		systemchat "POLICE CATCH YOU WITH DRUGS AND REMOVE IT FROM YOUR POKETS";
		}; 
       
		}else{
		 _hempqty = {_x == "ItemKiloHemp"} count magazines player;
		if (_hempqty > 0) exitWith{
		{player removeMagazine "ItemKiloHemp"} count (magazines player);
		systemchat "POLICE CATCH YOU WITH DRUGS AND REMOVE IT FROM YOUR POKETS";
		}; 
		};
		 sleep 0.1;
    };

in mission.sqm (into class sensor)

class Item Your item Value Here
        {
            position[]={Your Own coords here};
            a=30;
            b=30;
            activationBy="ANY";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="policezone";
            expCond="(vehicle player) in thislist;";
            expActiv="titleText [""Warning Police Check Control"", ""PLAIN DOWN""];policezone = [] execVM ""scripts\police.sqf"";";
            expDesactiv="terminate policezone; titleText [""Leaving Police Check Control"", ""PLAIN DOWN""];";
            class Effects
            {
            };
        };

 

 

Share this post


Link to post
Share on other sites
Error in expression <icle _weed;
[_objectID,_objectUID] call server_deleteObj;
deleteVehicle _weed;
P>
  Error position: <server_deleteObj;
deleteVehicle _weed;
P>
  Error Nicht definierte Variable in Ausdruck: server_deleteobj
File mpmissions\__CUR_MP.Chernarus\Scripts\drugs\cuthemp.sqf, line 36

:-(

Share this post


Link to post
Share on other sites
17 minutes ago, oldmatechoc said:

@oldmatechoc

where i add this ? so?

 

if !(_nearWeed) exitWith {
 systemChat("Needs be near of a FiberPlant");
};
if (_hempqty > 2) exitWith { 
    systemChat("Youre Full of Drugs");
};

	disableSerialization;
	_gearmenu = FindDisplay 106;
	_gearmenu CloseDisplay 106;
	player playActionNow "Medic";
	r_interrupt = false;
	sleep 6;
	if (isServer) then {
		PVDZE_obj_Delete call server_deleteObj;
	} else {
		PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer];
		publicVariableServer "PVDZE_obj_Delete";
	};
	player addMagazine "ItemKiloHemp";
	sleep 2;
	 systemChat("NICE LETS SMOKE OR SELL");
     
    

 

Share this post


Link to post
Share on other sites

wait.. i dont have any kind of error on my rpt when harvest the fiberplant . using the original code

18:27:08 "RUNNING EVENT: weedfarm on [2017,1,12,13,27]"
18:27:42 "DELETE: Player <NULL-object> deleted object with UID: 0"

 

Share this post


Link to post
Share on other sites

Error in expression <icle _weed;
[_objectID,_objectUID] call server_deleteObj;
deleteVehicle _weed;
P>
  Error position: <server_deleteObj;
deleteVehicle _weed;
P>
  Error Nicht definierte Variable in Ausdruck: server_deleteobj <- clientsite RPT

Share this post


Link to post
Share on other sites
1 minute ago, coresync said:

Error in expression <icle _weed;
[_objectID,_objectUID] call server_deleteObj;
deleteVehicle _weed;
P>
  Error position: <server_deleteObj;
deleteVehicle _weed;
P>
  Error Nicht definierte Variable in Ausdruck: server_deleteobj <- clientsite RPT

do you spawn the fiberplants as event?

Share this post


Link to post
Share on other sites
1 minute ago, coresync said:

yes

try replace the whole cuthemp.sqf with this:

Spoiler
private ["_gearmenu","_playerPos","_nearWeed","_weed","_objectID","_objectUID"];
_playerPos = getPosATL player;
_hempqty = {_x == "ItemKiloHemp"} count magazines player;
_nearWeed = count nearestObjects [_playerPos, ["fiberplant"], 4] > 0;
_weed = nearestObject [player, "fiberplant"];

if !(_nearWeed) exitWith {
	cutText [format["Needs be near of a FiberPlant."], "PLAIN DOWN"];
};
if (_hempqty > 2) exitWith { 
    cutText [format["WARNING: %1, YOure Full of Drugs survivor", name player], "PLAIN DOWN"];
};

	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;
	//PVDZ_obj_Destroy = [_objectID,_objectUID,_weed];
    //publicVariableServer "PVDZ_obj_Destroy";
	player addMagazine "ItemKiloHemp";
	sleep 2;
	cutText [format["NICE LETS SMOKE AND SELL"], "PLAIN DOWN"];	

 

if still not work, uncoment the two lines

Share this post


Link to post
Share on other sites

@juandayz so it is working, without server_deleteobj

/*
rewrited by juandayz for epoch 1.6
put together for DayZ Epoch
Credits to Shogun338 from Insurrection gaming
modified for separate "gather weed" script
*/

private ["_gearmenu","_playerPos","_nearWeed","_weed","_objectID","_objectUID"];
_playerPos = getPosATL player;
_hempqty = {_x == "ItemKiloHemp"} count magazines player;
_nearWeed = count nearestObjects [_playerPos, ["fiberplant"], 4] > 0;
_weed = nearestObject [player, "fiberplant"];

if !(_nearWeed) exitWith {
 systemChat("Needs be near of a FiberPlant");
};
if (_hempqty > 2) exitWith { 
    systemChat("YOure Full of Drugs");
};


	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;
	deleteVehicle _weed;
	PVDZ_obj_Destroy = [_objectID,_objectUID,_weed];
    publicVariableServer "PVDZ_obj_Destroy";
	player addMagazine "ItemKiloHemp";
	sleep 2;
	 systemChat("NICE LETS SMOKE OR SELL");

 

Share this post


Link to post
Share on other sites
4 hours ago, kingpapawawa said:

looking for a way to spawn a few ai at these locations... wai or dzai or??

Go download those admin events, look at the rubble town mission, there are ai in there that you could use as an example to add ai to the hemp mission. If you can't figure it out from that, I can help you more, but it's pretty easy. Make sure you copy the private variables for the enemyai and each variable used for the ai. If you read through the rubble mission you should understand...

Share this post


Link to post
Share on other sites

In case anyone else uses knife blunting, you would need to add the following extra code to your extra_rc.hpp:

	class ItemKnife5 {
        class farmhemp {
            text = "Harvest the weed";
            script = "execVM 'custom\drugs\cuthemp.sqf'";
        };
    };
	class ItemKnife4 {
        class farmhemp {
            text = "Harvest the weed";
            script = "execVM 'custom\drugs\cuthemp.sqf'";
        };
    };
	class ItemKnife3 {
        class farmhemp {
            text = "Harvest the weed";
            script = "execVM 'custom\drugs\cuthemp.sqf'";
        };
    };
	class ItemKnife2 {
        class farmhemp {
            text = "Harvest the weed";
            script = "execVM 'custom\drugs\cuthemp.sqf'";
        };
    };
	class ItemKnife1 {
        class farmhemp {
            text = "Harvest the weed";
            script = "execVM 'custom\drugs\cuthemp.sqf'";
        };
    };

 

Share this post


Link to post
Share on other sites
22 minutes ago, calamity said:

hope its for medicinal purposes///

heals you on my server and gives you the munchies LOL Id say its medicinal haha

Share this post


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

  • Similar Content

    • By Tricks
      We are back! Ranked 7th overall in 2014! Classic DayZ Epoch PvP Server!! No stupid start bonus, no heavy military. Just classic Epoch gameplay with new updates!

       
      - Top of the Line Hardware - Overclocked 8700k servers with SSDs. Super high FPS!!

      - XP System & XP Trader - Acquire handy Perks, Skills, and Permits with our XP system!

      - Custom Traders - Totally custom traders unique to this server!

      - Military Bases - High Loot areas perfect for gearing up.

      - Custom Map Content - Aircraft Carriers, Secret Military Bases, New Towns, and more!

      - All The Major Mods - All the major mods like Coin System, Heli Evac, Hide from Zeds, and many more.

      - Lots of AI Missions - Challenging AI missions color-coded by difficulty.

      - Custom AI Missions for Groups - Static missions with super high difficulty and major loot rewards!

      - Realistic Loot Spawns - You wont find high-powered weapons while hunting for loot, realistic loot spawns.

      - No Heavy Weapons, Tanks, Attack Choppers, Jets - Just the classic Epoch vehicles with a few new additions!

      - Lots of Vehicles - Lots of vehicles scattered around the map. Some are ready to go, others need to be fixed first!

      - Base Building - Fully modular base building system with unique build items and crafting recipes.

      - Full Day/Night Cycle - Realistic day and night cycle, no stupid 24 hours daylight!!

      - Full Weather System - Rain, thunderstorms and snow in the winter!!

      - Destructible Base/Garage Doors - Base raiding without losing your whole base! Just the doors are destructible.

      - Abandoned Safes/Lockboxes - Abandoned bases will have their safes unlocked for you to raid!!

      - Fresh Server, All The Best Base Locations Still Available! - No more wipes, server is done and all progress will be saved.

      - Regular Updates/Suggestions Considered - Pass along ideas to the admin staff. We consider all changes.

      - Admin Events - Events with High Loot and great times! See pic below.

      - Active Admin Staff - Find us on Discord anytime or by email!





      Connect to us on DayZ Launcher or directly:

      [SHG]ClassicEpoch|XPSystem|CustomTraders|CustomAImissions|Coins|FPS++

      144.217.62.76:2302

      Discord: http://xn--discrd-zxa.com/join.php?v=OXHD95

      Email: [email protected]

      Website: Under construction


    • By Tricks
      I have been browsing the forums looking for unique mods to add to my server. I noticed Juandayz deleted a lot of his mods before leaving the community. Just curious if anyone has them all and would possibly repost them giving him full credit? I am particularly interested in his "Admin Skin" and "Debug" mods.
       
      Thanks community, here's hoping someone will step up!
    • By victorks
      my first work in editin :) https://uploaddeimagens.com.br/imagens/20180307202515_1-jpg https://uploaddeimagens.com.br/imagens/20180307202245_1-jpg DOWNLOAD: https://www.dropbox.com/s/oq97j7x59362kqe/CASTLEai.sqf?dl=0 AI M2 NEED WAI: https://pastebin.com/GJMnPvZP ON THE MAP: https://pastebin.com/cyqH9rNV  
       
      https://www.dropbox.com/s/oq97j7x59362kqe/CASTLEai.sqf?dl=0
       
       
       
       
       
       
       
       
       
    • By juandayz
      VIDEO:
      If (You dont have a custom compiles.sqf or a custom keyboard.sqf) exitWith { step1;}else{ proceed with step 2; } forEach user; 1-Making a custom compiles.sqf and custom keyboard.sqf
       
       
      2-In your CUSTOM!!! keyboard.sqf at bottom but before the last "_handled" paste:
      3-Create remote_key.sqf  (mpmissions\your instance\scripts\ )
       
  • Advertisement
  • Advertisement
  • Supporters
  • Advertisement
  • Discord

×