Jump to content
  • 0

Crafting/deploying vehicles


kat

Question

So im trying to spawn in a mozzie through maca's right click options via toolbox, That all works fine... 

I've found a script posted by Player 2 on opendayz, which works through the scroll menu.

How can i modify the 'deploymozzie.sqf' file so it uses 1 x scrap and 1 x Engine parts through right click options?

 

My skills are very limited with this so ELI5!

 

 

//////////////////////////////This is from what is ment to go into selfactions

 

if ("ItemToolbox" in _weapons && "PartGeneric" in _mags && "PartEngine" in _mags) then {
hasMozzieItem = true;
} else { hasMozzieItem = false;};
if((speed player <= 1) && hasMozzieItem && _canDo) then {
 
////////////////////////////
 
 
//Deploymozzie.sqf
 
if (false) then {
cutText [format["You are in combat and cannot build a Mozzie."], "PLAIN DOWN"];
} else {
player removeAction s_player_deploymozzie;
player playActionNow "Medic";
r_interrupt = false;
player removeMagazine "PartGeneric";
player removeMagazine "PartEngine";
 
_dis=10;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
 
sleep 6;
 
_object = "CSJ_GyroC" createVehicle (position player);
_object setVariable ["ObjectID", "1", true];
_object setVariable ["ObjectUID", "1", true];
 
player reveal _object;
 
cutText [format["Mozzie Built"], "PLAIN DOWN"];
 
r_interrupt = false;
player switchMove "";
player playActionNow "stop";
 
sleep 10;
 
cutText [format["Deployed vehicles disappear on restart!"], "PLAIN DOWN"];
 
};
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

extra_rc.hpp 

class ExtraRc {
    class ItemToolbox {
        class MozzieDeploy {
            text = "Construct Mozzie";
            script = "execVM 'path\to\Deploymozzie.sqf'";
        };
    };
}; 
Deploymozzie.sqf
if (false) then {
cutText [format["You are in combat and cannot build a Mozzie."], "PLAIN DOWN"];
} else {
if ([["PartEngine"], "PartGeneric"] call player_checkAndRemoveItems) then { 
player removeAction s_player_deploymozzie;
player playActionNow "Medic";
r_interrupt = false;
 
_dis=10;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
 
sleep 6;
 
_object = "CSJ_GyroC" createVehicle (position player);
_object setVariable ["ObjectID", "1", true];
_object setVariable ["ObjectUID", "1", true];
 
player reveal _object;
 
cutText [format["Mozzie Built"], "PLAIN DOWN"];
 
r_interrupt = false;
player switchMove "";
player playActionNow "stop";
 
sleep 10;
 
cutText [format["Deployed vehicles disappear on restart!"], "PLAIN DOWN"];
 
};
};

Remember to whitelist the CSJ_GyroC in variables.sqf. That will make sure the server doesn't kill you when you enter the vehicle. Change the following line

DZE_safeVehicle = ["ParachuteWest","ParachuteC"]

to

DZE_safeVehicle = ["ParachuteWest","ParachuteC", "CSJ_GyroC"]
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...