Jump to content

Smoke on the water pipes in traders


Recommended Posts

Always wanted to smoke on the water pipes in the traders :D "Updated 4-4-2015"

Here it is

 

1.:

In your custom fn_selfaction add

        /////////////////////////////
	// water pipe Custom self actions
	_ispipe = _cursorTarget isKindOf "Land_Water_pipe_EP1";
	if (_ispipe && _canDo) then {
        if (s_player_pipe < 0) then {
        s_player_pipe = player addAction ["Smoke Pipe", "custom\pipesmoke.sqf",_cursorTarget, 1, true, true, "", ""];
        }
	} else {
        player removeAction s_player_pipe;
        s_player_pipe = -1;
	};
	/////////////////////////////

Just after

         } else {
    		player removeAction s_player_maintain_area;
    		s_player_maintain_area = -1;
    		player removeAction s_player_maintain_area_preview;
    		s_player_maintain_area_preview = -1;
	 };

2.:

Add

        /////////////////////////////
	// Water pipe Custom self actions
	player removeAction s_player_pipe;
	s_player_pipe = -1;
	/////////////////////////////
	};

Just before

               };

//Dog actions on player self

3.:

in your custom folder make a file and call it pipesmoke.sqf

 private ["_chance", "_drugTrip", "_trip"];
 

_chance = floor(random 100);
_trip = _this select 2;
_drugTrip = time + 60 + (_trip * 2);

player playActionNow "Medic";
sleep 1;
_nul = [objNull, player, rSAY, "bong"] call RE;
liafu = true;
Flare = "SmokeShell" createVehicle position player;
if (vehicle player != player) then { Flare attachTo [vehicle player,[0,0,0.]];}
        else {Flare attachTo [player,[0,0,0.]];};
_nul = [objNull, player, rSAY, "cough"] call RE;
 sleep 5;
titleText ["You inhale deeply from the hookah.","PLAIN DOWN"]; titleFadeOut 5;
sleep 5;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
 
        
if (_chance > 10) then
    {

    titleText ["You are stoned as a motherfucker.","PLAIN DOWN"]; titleFadeOut 5;
    while {time < _drugTrip} do {

        _force = random 10;
        "chromAberration" ppEffectEnable true;
        "chromAberration" ppEffectAdjust [_force / 24, _force / 24, false];
        "chromAberration" ppEffectCommit (0.3 + random 0.1);
        waituntil {ppEffectCommitted "chromAberration"};
        r_player_inpain = false;
        player setVariable["USEC_inPain",false,false];
        r_player_injured = false;
        player setVariable ["USEC_injured",false,false];
        player setVariable ["NORRN_unconscious", false, false];
        player setVariable ["unconsciousTime", 0, false];
        r_fracture_legs = false;
        player setVariable ["medForceUpdate",true,true];
        r_fracture_arms = false;
        player setHit["legs",0];
        player setHit["hands",0];    
        
        sleep 0.6;

        };  
    
    }
else
    {

    titleText ["That shit must have been laced.","PLAIN DOWN"]; titleFadeOut 5;
    while {time < _drugTrip} do {


        _force = random 10;
        "chromAberration" ppEffectEnable true;
        "chromAberration" ppEffectAdjust [_force / 24, _force / 24, false];
        "chromAberration" ppEffectCommit (0.3 + random 0.1);
        "colorInversion" ppEffectEnable true;
        "wetDistortion" ppEffectEnable true;
        waituntil {ppEffectCommitted "chromAberration"};
        sleep 0.6;


        };  
    };

    
"colorInversion" ppEffectEnable false;
"wetDistortion" ppEffectEnable false;
"colorCorrections" ppEffectAdjust [1, 1, 0, [0.5,0.5,0.5,0], [0.5,0.5,0.5,0], [0.5,0.5,0.5,0]];
"colorCorrections" ppEffectCommit 10;
waitUntil {ppEffectCommitted "colorCorrections"};
"colorCorrections" ppEffectEnable false;
"chromAberration" ppEffectEnable false;
 titleText ["Your brain is finally starting to feel normal again.","PLAIN DOWN"]; titleFadeOut 5;
 r_player_inpain = false;
player setVariable["USEC_inPain",false,false];
r_player_injured = false;
player setVariable ["USEC_injured",false,false];
r_fracture_legs = false;
player setVariable ["medForceUpdate",true,true];
r_fracture_arms = false;
player setHit["legs",0];
player setHit["hands",0];    
 
 //Thanks to Smokey Meadow for the smoke script.

 

     And extract the files to the root of your mission file.
 
5.: in your description.ext add this
 

 

class CfgSounds
{
    sounds[] = 
{
bong, cough
};

 

class cough

{
name="cough";
sound[]={cough.ogg,0.9,1};
titles[] = {};
};
 
class bong
{
name="bong";
sound[]={bong.ogg,0.9,1};
titles[] = {};
};
 
};

 

 
 
 

Thanks too Smokey Meadow for the smoke script  :)

 

Thats it.

hope it makes sense. Its my first tutorial 

 

Come and vissit my Op-PVP Server 5.103.68.98 2302

Link to comment
Share on other sites

IIRC then this object is spawned by the mission.sqf script in the dayz_server.pbo ... in that case an even easier way to do this would be to add the option to the init of the object like this:

_unit setVehicleInit "this addAction ['Smoke Pipe','custom\pipesmoke.sqf', [], 1, true, true, '', '_this distance _target < 4'];";
processInitCommands;
Link to comment
Share on other sites

 

IIRC then this object is spawned by the mission.sqf script in the dayz_server.pbo ... in that case an even easier way to do this would be to add the option to the init of the object like this:

_unit setVehicleInit "this addAction ['Smoke Pipe','custom\pipesmoke.sqf', [], 1, true, true, '', '_this distance _target < 4'];";
processInitCommands;

 

Do I copy this at the bottom of the mission file?

Link to comment
Share on other sites

i found a script very similar to this about 2 years ago here is the link Drugs and effects the first script is to make speed/meth whatever u wanna call it combine these together  ItemMorphine & ItemPainkiller & ItemEpinephrine

 

4th post from the top is the smoke bong script with sounds

 

//HITS FROM THE BONG START
if(cursorTarget isKindOf "Land_Water_pipe_EP1" and _canDo and (player distance cursorTarget < 4)) then {
    if (s_player_hippy < 0) then {
    s_player_hippy = player addAction ["Hit the Bong","scripts\pot.sqf",cursorTarget, 0, false, true, "",""];
    };
    } else {
    player removeAction s_player_hippy;
    s_player_hippy = -1;
    };
//HITS FROM THE BONG END

 

 

 private ["_chance", "_drugTrip", "_trip"];
 

_chance = floor(random 100);
_trip = _this select 2;
_drugTrip = time + 60 + (_trip * 10);

player playActionNow "Medic";
sleep 1;
_nul = [objNull, player, rSAY, "bong"] call RE;
 sleep 3;
titleText ["You inhale deeply from the hookah.","PLAIN DOWN"]; titleFadeOut 5;
sleep 5;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
 dayzHumanity = [player,-100];
 _id = dayzHumanity spawn player_humanityChange;


liafu = true;
Flare = "SmokeShell" createVehicle position player;
if (vehicle player != player) then { Flare attachTo [vehicle player,[0,0,0.]];}
        else {Flare attachTo [player,[0,0,0.]];};
_nul = [objNull, player, rSAY, "cough"] call RE;
 sleep 1;
       
if (_chance > 10) then
    {

    titleText ["You are stoned as a motherfucker.","PLAIN DOWN"]; titleFadeOut 5;
    while {time < _drugTrip} do {

        _force = random 10;
        "chromAberration" ppEffectEnable true;
        "chromAberration" ppEffectAdjust [_force / 24, _force / 24, false];
        "chromAberration" ppEffectCommit (0.3 + random 0.1);
        waituntil {ppEffectCommitted "chromAberration"};
        r_player_inpain = false;
        player setVariable["USEC_inPain",false,false];
        r_player_injured = false;
        player setVariable ["USEC_injured",false,false];
        player setVariable ["NORRN_unconscious", false, false];
        player setVariable ["unconsciousTime", 0, false];
        r_fracture_legs = false;
        player setVariable ["medForceUpdate",true,true];
        r_fracture_arms = false;
        player setHit["legs",0];
        player setHit["hands",0];    
       
        sleep 0.6;

        };  
   
    }
else
    {

    titleText ["That shit must have been laced.","PLAIN DOWN"]; titleFadeOut 5;
    while {time < _drugTrip} do {


        _force = random 10;
        "chromAberration" ppEffectEnable true;
        "chromAberration" ppEffectAdjust [_force / 24, _force / 24, false];
        "chromAberration" ppEffectCommit (0.3 + random 0.1);
        "colorInversion" ppEffectEnable true;
        "wetDistortion" ppEffectEnable true;
        waituntil {ppEffectCommitted "chromAberration"};
        sleep 0.6;


        };  
    };

   
"colorInversion" ppEffectEnable false;
"wetDistortion" ppEffectEnable false;
"colorCorrections" ppEffectAdjust [1, 1, 0, [0.5,0.5,0.5,0], [0.5,0.5,0.5,0], [0.5,0.5,0.5,0]];
"colorCorrections" ppEffectCommit 10;
waitUntil {ppEffectCommitted "colorCorrections"};
"colorCorrections" ppEffectEnable false;
"chromAberration" ppEffectEnable false;
 titleText ["Your brain is finally starting to feel normal again.","PLAIN DOWN"]; titleFadeOut 5;
 r_player_inpain = false;
player setVariable["USEC_inPain",false,false];
r_player_injured = false;
player setVariable ["USEC_injured",false,false];
r_fracture_legs = false;
player setVariable ["medForceUpdate",true,true];
r_fracture_arms = false;
player setHit["legs",0];
player setHit["hands",0];    
 
 //Bong Hits by Smokey Meadow

 

class cough
{
name="cough";
sound[]={sound\cough.ogg,0.9,1};
titles[] = {};
};
class bong
{
name="bong";
sound[]={sound\hookah.ogg,0.9,1};
titles[] = {};
};

 

You should download the hookah.ogg & cough.ogg sound files and add it to your script so when players smoke up they hear a few coughs and the bong in action

Link to comment
Share on other sites

Do I copy this at the bottom of the mission file?

 

(assuming you run chernarus map) in dayz_server\mission\DayZ_Epoch_11.Chernarus\mission.sqf find this part:

_vehicle_292 = objNull;
if (true) then
{
  _this = createVehicle ["Land_Water_pipe_EP1", [6314.9482, 7790.9653, 0.093142167], [], 0, "CAN_COLLIDE"];
  _vehicle_292 = _this;
  _this setDir 252.18881;
  _this setVehicleInit "this allowDammage false;this enableSimulation false;";
  _this setPos [6314.9482, 7790.9653, 0.093142167];
};

change this:

_this setVehicleInit "this allowDammage false;this enableSimulation false;";

to this:

_this setVehicleInit "this allowDammage false;this enableSimulation false;this addAction ['Smoke Pipe','custom\pipesmoke.sqf', [], 1, true, true, '', '_this distance _target < 4'];";

and it will work aswell ... then you wont need to edit fn_selfactions

Link to comment
Share on other sites

Hey man i noticed you have changed hookah.ogg to bong.ogg but you have
 
class CfgSounds
{
    sounds[] = 
{
hookah, cough
};

 

class cough

{
name="cough";
sound[]={cough.ogg,0.9,1};
titles[] = {};
};
 
class bong
{
name="bong";
sound[]={bong.ogg,0.9,1};
titles[] = {};
};
 
you need to change
    sounds[] = 
{
hookah, cough
};
 
to match what you did so it would be
 
    sounds[] = 
{
bong, cough
};
 
;)
Link to comment
Share on other sites

(assuming you run chernarus map) in dayz_server\mission\DayZ_Epoch_11.Chernarus\mission.sqf find this part:

_vehicle_292 = objNull;
if (true) then
{
  _this = createVehicle ["Land_Water_pipe_EP1", [6314.9482, 7790.9653, 0.093142167], [], 0, "CAN_COLLIDE"];
  _vehicle_292 = _this;
  _this setDir 252.18881;
  _this setVehicleInit "this allowDammage false;this enableSimulation false;";
  _this setPos [6314.9482, 7790.9653, 0.093142167];
};

change this:

_this setVehicleInit "this allowDammage false;this enableSimulation false;";

to this:

_this setVehicleInit "this allowDammage false;this enableSimulation false;this addAction ['Smoke Pipe','custom\pipesmoke.sqf', [], 1, true, true, '', '_this distance _target < 4'];";

and it will work aswell ... then you wont need to edit fn_selfactions

 

Works very well, Thank you Halvhjearne!

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
  • Discord

×
×
  • Create New...