Jump to content

[TUTORIAL] Harvestable hemp, smoking weed, pot farms.


FragZ

Recommended Posts

 

look in your  arma2oaserver.RPT

for this

 

7:40:58 "[Random_Weed_Farm]: waiting for BIS_fnc_findSafePos"
 7:40:58 "[Random_Weed_Farm]: Function loaded ... Server Building 2 Weed Farm(s)"
 7:40:58 "[Random_Weed_Farm]: Found Location for a farm (136089) [13639.6,16120.6] with 6 plants"
 7:40:58 "[Random_Weed_Farm]: Found Location for a farm (128144) [12888.1,10613.6] with 4 plants"
 7:40:58 "[Random_Weed_Farm]: Weed Farm(s) Done ... Broadcasting locations for clients"

if you have that then the farms are spawning

 

Hi   I found it in my rpt on an earlier boot but its not showing up on markers is there something else I have to do to make sure that happens?

 

FIXED:   had items on server side moved to mission side and it is now working

Link to comment
Share on other sites

  • 2 weeks later...

 

Added an option to add a green smoke effect to the player who smokes.

Flare = "SmokeShellGreen" createVehicle position player;
        if (vehicle player != player) then { Flare attachTo [vehicle player,[0,0,0.]];}
                else {Flare attachTo [player,[0,0,0.]];};

That's a nice addition, but players get kicked and banned for BadVar: Flare

Tried several things, but couldn't handle it so far to set up the filters.

Any suggestions?

Link to comment
Share on other sites

That's a nice addition, but players get kicked and banned for BadVar: Flare

Tried several things, but couldn't handle it so far to set up the filters.

Any suggestions?

That is because it creates a Var that has not been whitelisted. I do not have this problem as I do not use BE filters for Variables, rather using my custom antihack.

If you have another antihack, please let me know because it might be because of that (InfiSTAR as an example).

Link to comment
Share on other sites

Yes, server runs Infistar antihack.

But I already recognized that there is no AH.sqf belong the files to configure.

Mine never blacklisted those vars so I did not think it was necessary. It depends on your AHconfig setup I guess. I use my own antihack side-by-side with infistar now so :P

Link to comment
Share on other sites

im fairly new to running a server but with wickidai  couldnt you make it so when the mayor or president is spawned it just re executes halvs script and randomly spawns more again ?

 

or tie it to some kind of mission so when it spawns (which is random and time based) it runs the script....

 

Or does this only exec on reboots ?

 

also thanks for the script and alot of the info i had the same problem as some i read all the comments..  basicly you need to call it from init.sqf not server_function.sqf if your missing the green markers.   :)

 

Im wondering if we can make this spawn with some bandits also its not just a who ever gets there first type deal.

surely we can combo halvs spawning method into the ai missions ?

 

 

edit : 

i added hemp to my Trader_DATA table and rebooted the server but still cant sell? 

i added it to the menu  in the CfgServerTrader 

Drugs.hpp

class Category_4200 {
 
class ItemKiloHemp {
type = "trade_items";
buy[] = {1,"ItemBriefcase20oz"};
sell[] = {1,"ItemBriefcase50oz"};
};
};
 
 
edit server_traders.sqf
 
// Black market
menu_GUE_Woodlander2 = [
[["Black Market Ammo",527],["Black Market Weapons",526],["Explosives",529],["Gems",1013],["Drugs",4200]],
[],
"neutral"
];
 
 
 

 

b_edit.png Edit b_inline_edit.png Inline Edit b_insrow.png Copy b_drop.png Delete 8151 ["ItemKiloHemp",1] 10 [1,"ItemBriefcase10oz",1] [1,"ItemBriefcase10oz",1] 0 4200

trade_items

 

i

 

Not sure why i still cant sell ?

Link to comment
Share on other sites

im fairly new to running a server but with wickidai  couldnt you make it so when the mayor or president is spawned it just re executes halvs script and randomly spawns more again ?

 

or tie it to some kind of mission so when it spawns (which is random and time based) it runs the script....

 

Or does this only exec on reboots ?

 

also thanks for the script and alot of the info i had the same problem as some i read all the comments..  basicly you need to call it from init.sqf not server_function.sqf if your missing the green markers.   :)

 

Im wondering if we can make this spawn with some bandits also its not just a who ever gets there first type deal.

surely we can combo halvs spawning method into the ai missions ?

 

 

edit : 

i added hemp to my Trader_DATA table and rebooted the server but still cant sell? 

i added it to the menu  in the CfgServerTrader 

Drugs.hpp

class Category_4200 {
 
class ItemKiloHemp {
type = "trade_items";
buy[] = {1,"ItemBriefcase20oz"};
sell[] = {1,"ItemBriefcase50oz"};
};
};
 
 
edit server_traders.sqf
 
// Black market
menu_GUE_Woodlander2 = [
[["Black Market Ammo",527],["Black Market Weapons",526],["Explosives",529],["Gems",1013],["Drugs",4200]],
[],
"neutral"
];
 
 
 

 

b_edit.png Edit b_inline_edit.png Inline Edit b_insrow.png Copy b_drop.png Delete 8151 ["ItemKiloHemp",1] 10 [1,"ItemBriefcase10oz",1] [1,"ItemBriefcase10oz",1] 0 4200

trade_items

 

i

 

Not sure why i still cant sell ?

On my side, I just have a custom trader (you could use an existing one instead) and add it to the trader's menu. I made it so its like any other magazine/item (added using an SQL query).

Link to comment
Share on other sites

all good i forgot to call it in my cfgServerTrader.hpp

 

i woke up this morning and remembered lol

 

all working good. 

 

I added 30 - 50 plants per farm    4 - 5 farms

 

1gold per hemp

 

this is the only way i can think of making it accessable to players that dont log in on first boot and not make everyone too rich for little effort ..

 

im trying to get it to merge with my mission files. if i get success ill share :)

Link to comment
Share on other sites

I'm not using WAI anymore, but I had still a weed mission on my harddrive which I copied from the C130 mission...

 

Create a file C130_weed.sqf and paste this inside. Save it to your WAI\missions\ folder.

//C130 Weed

private ["_playerPresent","_cleanmission","_currenttime","_starttime","_missiontimeout","_position"];

_position = [getMarkerPos "center",0,2500,10,0,200,0] call BIS_fnc_findSafePos;
diag_log format["WAI: Wrecked C130 Weed Mission Started At %1",_position];

_baserunover = createVehicle ["C130J_wreck_EP1",[(_position select 0), (_position select 1),0],[], 0, "CAN_COLLIDE"];

//Small Gun Box 2
_box = createVehicle ["RUBasicWeaponsBox",[(_position select 0) + 25,(_position select 1) + 15,0], [], 0, "CAN_COLLIDE"];
[_box] call Small_Gun_box2;


[[_position select 0, _position select 1, 0],6,1,"Random",4,"","Rocker3_DZ","Random",true] call spawn_group;

[[_position select 0, _position select 1, 0],6,1,"Random",4,"","Rocker4_DZ","Random",true] call spawn_group;

//Turrets
[[[(_position select 0) + 10, (_position select 1) + 10, 0],[(_position select 0) + 10, (_position select 1) - 10, 0]],"M2StaticMG",0.9,"Rocker4_DZ",0,2,"","Random",true] call spawn_static;
[[[(_position select 0) - 10, (_position select 1) - 10, 0]],"TOW_TriPod",0.8,"TK_GUE_Soldier_AAT_EP1",1,2,"","Random",true] call spawn_static;

[_position,"C130 Weed"] execVM "\z\addons\dayz_server\WAI\missions\compile\markers.sqf";
[nil,nil,rTitleText,"Hippies crashed fully stoned a C-130 carrying 50kg of weed! Confiscate it!", "PLAIN",10] call RE;
    
_missiontimeout = true;
_cleanmission = false;
_playerPresent = false;
_starttime = floor(time);
while {_missiontimeout} do {
    sleep 5;
    _currenttime = floor(time);
    {if((isPlayer _x) AND (_x distance _position <= 150)) then {_playerPresent = true};}forEach playableUnits;
    if (_currenttime - _starttime >= wai_mission_timeout) then {_cleanmission = true;};
    if ((_playerPresent) OR (_cleanmission)) then {_missiontimeout = false;};
};
if (_playerPresent) then {
    waitUntil
    {
        sleep 5;
        _playerPresent = false;
        {if((isPlayer _x) AND (_x distance _position <= 30)) then {_playerPresent = true};}forEach playableUnits;
        (_playerPresent)
    };
    diag_log format["WAI: Wrecked C130 Weed Mission Ended At %1",_position];
    [nil,nil,rTitleText,"Survivors have secured the Weed! Don't smoke too much of it!", "PLAIN",10] call RE;
} else {
    clean_running_mission = True;
    deleteVehicle _box;
    {_cleanunits = _x getVariable "missionclean";
    if (!isNil "_cleanunits") then {
        switch (_cleanunits) do {
            case "ground" :  {ai_ground_units = (ai_ground_units -1);};
            case "air" :     {ai_air_units = (ai_air_units -1);};
            case "vehicle" : {ai_vehicle_units = (ai_vehicle_units -1);};
            case "static" :  {ai_emplacement_units = (ai_emplacement_units -1);};
        };
        deleteVehicle _x;
        sleep 0.05;
    };    
    } forEach allUnits;
    
    diag_log format["WAI: Wrecked C130 Weed Mission Timed Out At %1",_position];
    [nil,nil,rTitleText,"Survivors did not secure the weed in time! Mood of inhabitants increases steadily!", "PLAIN",10] call RE;
};
missionrunning = false;

 

Add

"C130_weed"

to your missionCfG.sqf

 

wai_missions = [
"bandit_base",
"armed_vehicle",
"disabled_civchopper",
"crash_spawner",
"disabled_milchopper",
"MV22",
"weapon_cache",
"mayors_mansion",
"convoy",
"C130_crash",
"C130_weed",
"ems_cache",
"medi_camp",
"Ural"
];

 

In your WAI\missions\compile folder create a file SmallGunBox2.sqf and paste this in:

//Small Gun Box 2

_box = _this select 0;
_box setVariable ["ObjectID","1",true];
_box setVariable ["permaLoot",true];
PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_box];

clearWeaponCargoGlobal _box;
clearMagazineCargoGlobal _box;

// TOOLS
_box addWeaponCargoGlobal ["ItemMatchbox_DZE", 5];

// WEED
_box addMagazineCargoGlobal ["ItemKiloHemp", 50];

// BACKPACKS
_box addBackpackCargoGlobal ["DZ_LargeGunBag_EP1", 1];

Add this line:

Small_Gun_Box2 = compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\missions\compile\SmallGunBox2.sqf";

to your missionIni.sqf

 

Fight for weed! :)

Link to comment
Share on other sites

 

would proberbly be better if you changed it to check if players inventory is full instead ... tbh i think setting a limit to how many you can have in your inventory is a bit stupid, since you can just put some down and harvest more, however checking if inventory is full will make sure the player can not have more magazines than allowed in inventory.

 

also i made a little somethin-somethin here for everyone who does not know how to use the editor or if you are just tierd of the same old field in the same old spot:

 

this script will create a random amount of farms and plants each restart, plants are created "labyrinth style" so it will seem like its placed perfectly close no matter how many plants you want and where they end up, markers are automaticly set for each farm and there is an option to blacklist areas like tradecitys ... (as always in my scripts) there is a few settings you can customize a bit ...

you can set how many farms you want max/min, how many plants you want max/min, how far from roads you want it to spawn and blacklisted areas where weed will not spawn (areas for cherno and napf is preset).

 

have fun:

 

 

 

So what do we do with this file? put it in missions.pbo\scripts and then in init.sqf add evecVM "Scripts\weedfarms.sqf"; ?

Or how do this work? will this file load weed into the cherno map? Is there anything this file needs or is it a standalone file?

 

I already have the right click knife to harvest hemp and harvest weed... just no weed.. Im am now about to try this file and see how it goes but so far everything I have tried has failed :(

 

**EDIT**

I have just tried the above and It did not work. I followed the guide from page one and that has not worked there are NO map markers coming on the map after a restart to show the weeds location so I went back into editor and spammed a load of weed on the main road by cherno, restarted my server and there was no weed so clearly the item name is wrong for the cherno map but I know it can be done as Dreamfall epoch cherno server has it working.

 

The other thing I was thinking tho... Even if the weed did not spawn shouldn't the map markers spawn anyway?

 

**FILES**

SERVER.PBO

Buildings\weedfarm.sqf

 

SERVER.PBO\INIT.SQF

execVM "\z\addons\dayz_server\buildings\weedfarm.sqf";  (At the bottom of the file) (weed spawns from editor)

 

MISSION.PBO

custom\weed\hemp.sqf

custom\weed\smokeshit.sqf

custom\weed\weedfarms.sqf

custom\extra_rc.hpp

 

MISSION.PBO\INIT.SQF

evecVM "custom\weed\weedfarms.sqf";
evecVM "custom\weed\hemp.sqf";
evecVM "custom\weed\smokeshit.sqf";
 
MISSION.PBO\DESCRIPTION.EXT
#include "custom\extra_rc.hpp"
 
I have tried In different locations too just In case something did not like it but no matter where these go It just wont work. 
Link to comment
Share on other sites

 

So what do we do with this file? put it in missions.pbo\scripts and then in init.sqf add evecVM "Scripts\weedfarms.sqf"; ?

Or how do this work? will this file load weed into the cherno map? Is there anything this file needs or is it a standalone file?

 

I already have the right click knife to harvest hemp and harvest weed... just no weed.. Im am now about to try this file and see how it goes but so far everything I have tried has failed :(

 

**EDIT**

I have just tried the above and It did not work. I followed the guide from page one and that has not worked there are NO map markers coming on the map after a restart to show the weeds location so I went back into editor and spammed a load of weed on the main road by cherno, restarted my server and there was no weed so clearly the item name is wrong for the cherno map but I know it can be done as Dreamfall epoch cherno server has it working.

 

The other thing I was thinking tho... Even if the weed did not spawn shouldn't the map markers spawn anyway?

 

**FILES**

SERVER.PBO

Buildings\weedfarm.sqf

 

SERVER.PBO\INIT.SQF

execVM "\z\addons\dayz_server\buildings\weedfarm.sqf";  (At the bottom of the file) (weed spawns from editor)

 

MISSION.PBO

custom\weed\hemp.sqf

custom\weed\smokeshit.sqf

custom\weed\weedfarms.sqf

custom\extra_rc.hpp

 

MISSION.PBO\INIT.SQF

evecVM "custom\weed\weedfarms.sqf";
evecVM "custom\weed\hemp.sqf";
evecVM "custom\weed\smokeshit.sqf";
 
MISSION.PBO\DESCRIPTION.EXT
#include "custom\extra_rc.hpp"
 
I have tried In different locations too just In case something did not like it but no matter where these go It just wont work. 

 

Would maybe help if you posted your RPT file so we can check what errors you got. Halv's script needs to be called mission sided too idk which one you made spawn client side...

 

Link to comment
Share on other sites

I have managed to get the farms and map markers to spawn in but I am faced with a pretty odd problem...

 

Every single time I join my server my player falls on the floor rolling around and I'm stoned seen all those pretty colors.. any idea what could cause me to be stoned the second I join the server every time?

Link to comment
Share on other sites

/*
       by: http://infiSTAR.de  Credits to infistar for the actual script
       Edited by FragZ
 
    */
//Add this part after *while {true} do {* to add a smoke effect
  /*  Flare = "SmokeShellGreen" createVehicle position player;
    if (vehicle player != player) then { Flare attachTo [vehicle player,[0,0,0.]];}
       else {Flare attachTo [player,[0,0,0.]];}
*/
   [] spawn {
            hint "You took drugs YOLOLOLO";
			player removeMagazine 'ItemKiloHemp';
            Remove_Drug_effects =
            {
                    {
                            ppEffectDestroy _x;
                    } forEach (_this select 0);
                    ppEffectDestroy nonapsi_ef;
                    ppEffectDestroy wetdist1;
                    ppEffectDestroy ppe;
                    ppEffectDestroy ppe2;
                    ppEffectDestroy ppe3;
                    setaperture 0;
                    "dynamicBlur" ppEffectAdjust [0];
                    "dynamicBlur" ppEffectCommit 16;
                    "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1],  [1, 1, 1, 0.0]];
                    "colorCorrections" ppEffectCommit 0;
            };
            _time = time;
            _effects = [];
            player playMoveNow "ActsPercMstpSnonWpstDnon_sceneBardak01";
            while {true} do
            {
                    nonapsi_ef = ppEffectCreate ["colorCorrections", 1555];
                    _effects = _effects + [nonapsi_ef];
                    nonapsi_ef ppEffectEnable true;
                    nonapsi_ef ppEffectAdjust [1.0, 1.0, -0.03, [0.0, 0.0, 0.0, 0.0], [3.0, 5.0, 9.0, 5.0],[0.4,0.0,0.0, 0.7]];
                    nonapsi_ef ppEffectCommit 1;
                    sleep random(1);
                    wetdist1 = ppEffectCreate ["wetDistortion", 2006];
                    _effects = _effects + [wetdist1];
                    wetdist1 ppEffectAdjust [0, 8, 0.8,8,8, 0.2, 1, 0, 0, 0.08, 0.08, 0, 0, 0, 0.77];
                    wetdist1 ppEffectEnable true;
                    wetdist1 ppEffectCommit 0;
                    ppe = ppEffectCreate ["colorCorrections", 1555];
                    _effects = _effects + [ppe];
                    ppe ppEffectAdjust [1, 1, 0, [1.5,6,2.5,0.5], [5,3.5,5,-0.5], [-3,5,-5,-0.5]];
                    ppe ppEffectCommit 1;
                    ppe ppEffectEnable true;
                    ppe2 = ppEffectCreate ["chromAberration", 1555];
                    _effects = _effects + [ppe2];
                    ppe2 ppEffectAdjust [0.01,0.01,true];
                    ppe2 ppEffectCommit 1;
                    ppe2 ppEffectEnable true;
                    ppe3 = ppEffectCreate ["radialBlur", 1555];
                    _effects = _effects + [ppe3];
                    ppe3 ppEffectEnable true;
                    ppe3 ppEffectAdjust [0.02,0.02,0.15,0.15];
                    ppe3 ppEffectCommit 1;
                    sleep random(1);
                    wetdist1 = ppEffectCreate ["wetDistortion", 2006];
                    _effects = _effects + [wetdist1];
                    wetdist1 ppEffectAdjust [1, 1.16, 0.32, 2.56, 0.8, 0.64, 2.64, 0, 0, 1.08, 0.08, 0, 0, 0, 1.77];
                    wetdist1 ppEffectEnable true;
                    wetdist1 ppEffectCommit 0;
                    sleep random(1);
                    nonapsi_ef = ppEffectCreate ["colorCorrections", 1555];
                    _effects = _effects + [nonapsi_ef];
                    nonapsi_ef ppEffectEnable true;
                    nonapsi_ef ppEffectAdjust [1.0, 1.0, -0.02, [9.5, 1.5, 2.5, 0.2], [2.0, 7.0, 6.0, 2.0],[0.4,0.0,0.0, 0.7]];
                    nonapsi_ef ppEffectCommit 1;
                    sleep random(1);
                    if (_time + 60 < time) exitWith {[_effects] call Remove_Drug_effects;};
            };
    };

My smoke.sqf correct or not ?

Link to comment
Share on other sites

I have managed to get the farms and map markers to spawn in but I am faced with a pretty odd problem...

 

Every single time I join my server my player falls on the floor rolling around and I'm stoned seen all those pretty colors.. any idea what could cause me to be stoned the second I join the server every time?

I would guess you execute the stoned file somewhere where you should not, making it execute on client on join.

 

Look for that:)

Link to comment
Share on other sites

I can't harvest ive done everything correctly the only other thing that i can thin of is that the weed farm.sqf script does not realise it is the same "fiberplant" so it can't harvest im stuck for ideas can anyone help cheers.

 

Edit 
i also can't smoke it, it only comes up with craft canvas...

Link to comment
Share on other sites

Anyway to make this work in Arma 3? and instead of using fiberplant can we not use a trigger zone? basically like Altis life you walk into the trigger zones and you get an option to harvest weed, cocaine, fish and such? How can I pull this off?

I found this script http://www.bubblews.com/news/4229242-arma-3-virtual-harvesting-gathering-script-for-custom-missions

But that don't seem to actually work I get no scroll menu while I am in the created triggers. Any ideas?

 

I used your script on my ArmA 2 Epoch server and loved it I would much rather use a script from you than anyone else when it comes to weed, You done a great job :)

Link to comment
Share on other sites

  • 3 weeks later...

Is the weedfarms.sqf necessary to run this?

Im just trying to get the smokeshit.sqf and hemp.sqf to work in my extra_rc.hpp and it breaks the server. No error in my RPT. I already have deploy bike working via the extra_rc.hpp so Im just adding the SmokeWeed folder with the 2 scripts to my custom folder and the extra_rc.hpp looks like this.
 

class ExtraRc {
	class ItemToolbox {
               class Bike {
                        text = "Deploy Bike";
                        script = "execVM 'custom\deploy\bike.sqf'";
                };
	}; 
	class ItemKnife {
		class farmhemp {
			text = "Harvest the weed";
			script = "execVM 'custom\SmokeWeed\hemp.sqf'";
		
		};
	};
	class ItemKiloHemp {
		class smokeweed {
			text = "Smoke the shit";
			script = "execVM 'custom\SmokeWeed\smokeshit.sqf'";
		};
	};
};

This looks right to me so idk...

smokeshit.sqf

/*


by: ZeroK00L    
*/
    [] spawn {
    hint "You roll a fatty and smoke it! Damn! That shit is the chronic!";
    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);
r_player_blood = r_player_bloodTotal;            //set their blood to the maximum allowed
r_player_lowblood = false;                        //set lowblood setting to false
10 fadeSound 1;                                    //slowly fade their volume back to maximum
"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5;    //disable post processing blur effect
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1],  [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5;    //give them their colour back
r_player_lowblood = false;                        //just double checking their blood isnt low
player setVariable["USEC_BloodQty",r_player_bloodTotal,true];    //set their blood back up to maximum again
    if (_time + 60 < time) exitWith {[_effects] call Remove_Drug_effects;};
    };
    };

hemp.sqf

    /*


    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 {
    cutText [format["You need to be near the weed plants in order to gather."], "PLAIN DOWN"];
    };
    if (_hempqty > 2) exitWith {
    cutText [format["WARNING: %1, You have maximum amount of weed in your inventory! You could get arrested by the police ;)", name player], "PLAIN DOWN"];
    };
    if (dayz_combat == 1) then {
    cutText [format["You are in Combat and Cannot Gather the 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 at Black market dealer!!"], "PLAIN DOWN"];    
    };

 

EDIT- Nevermind it works... no idea what was going wrong. just restarted the server a couple of times and it was good to go.

Link to comment
Share on other sites

Is the weedfarms.sqf necessary to run this?

Im just trying to get the smokeshit.sqf and hemp.sqf to work in my extra_rc.hpp and it breaks the server. No error in my RPT. I already have deploy bike working via the extra_rc.hpp so Im just adding the SmokeWeed folder with the 2 scripts to my custom folder and the extra_rc.hpp looks like this.

 

class ExtraRc {
	class ItemToolbox {
               class Bike {
                        text = "Deploy Bike";
                        script = "execVM 'custom\deploy\bike.sqf'";
                };
	}; 
	class ItemKnife {
		class farmhemp {
			text = "Harvest the weed";
			script = "execVM 'custom\SmokeWeed\hemp.sqf'";
		
		};
	};
	class ItemKiloHemp {
		class smokeweed {
			text = "Smoke the shit";
			script = "execVM 'custom\SmokeWeed\smokeshit.sqf'";
		};
	};
};

This looks right to me so idk...

smokeshit.sqf

/*

by: ZeroK00L    

*/

    [] spawn {

    hint "You roll a fatty and smoke it! Damn! That shit is the chronic!";

    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);

r_player_blood = r_player_bloodTotal;            //set their blood to the maximum allowed

r_player_lowblood = false;                        //set lowblood setting to false

10 fadeSound 1;                                    //slowly fade their volume back to maximum

"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5;    //disable post processing blur effect

"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1],  [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5;    //give them their colour back

r_player_lowblood = false;                        //just double checking their blood isnt low

player setVariable["USEC_BloodQty",r_player_bloodTotal,true];    //set their blood back up to maximum again

    if (_time + 60 < time) exitWith {[_effects] call Remove_Drug_effects;};

    };

    };

hemp.sqf

    /*

    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 {

    cutText [format["You need to be near the weed plants in order to gather."], "PLAIN DOWN"];

    };

    if (_hempqty > 2) exitWith {

    cutText [format["WARNING: %1, You have maximum amount of weed in your inventory! You could get arrested by the police ;)", name player], "PLAIN DOWN"];

    };

    if (dayz_combat == 1) then {

    cutText [format["You are in Combat and Cannot Gather the 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 at Black market dealer!!"], "PLAIN DOWN"];    

    };

 

EDIT- Nevermind it works... no idea what was going wrong. just restarted the server a couple of times and it was good to go.

Mmmh weird, glad you got it to work!

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
×
×
  • Create New...