Jump to content
  • 0

Custom GUI Help


Dusty459

Question

Right I'm Using I think it was theduke  I'm trying to Add Deployable and Packable

Bike
Mozzie
atv
and the Ablility to Flip

iv tried combining Nox custom menu

Pack Bike https://www.dropbox.com/s/yc029uuykd1q3ky/packBike.sqf?dl=0
deploy bike https://www.dropbox.com/s/eg6tzr8smpsz70p/deploy_Bike.sqf?dl=0

PackMozzie https://www.dropbox.com/s/buer6ww0o3of882/packMozzie.sqf?dl=0

deploy mozzie https://www.dropbox.com/s/07ete13xaycclot/deployMozzie.sqf?dl=0

flip https://www.dropbox.com/s/imj565tzprehlmd/flipVehicle.sqf?dl=0

I'm not a coding But I thought it might work

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Ill send you my deploy and pack scripts here in a bit, im leaving for work in 5 min lol

as for the flip vehicle, its already included in epoch by default, the 1051 version you needed to have 2 players near the vehicle to flip. Looking at the code for this version of epoch, it seems it shold work with only one person.

 

This block of code is found in your fn_selfactions.sqf

//flip vehicle
	if (_isVehicle && {!_isMan} && {!(canMove _cursorTarget)} && {_isAlive} && {player distance _cursorTarget >= 2} && {(count (crew _cursorTarget))== 0} && {((vectorUp _cursorTarget) select 2) < 0.5}) then {
		if (s_player_flipveh < 0) then {
			s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",_cursorTarget, 1, true, true];
		};
	} else {
		player removeAction s_player_flipveh;
		s_player_flipveh = -1;
	};

ill get the rest later...

Link to comment
Share on other sites

  • 0

You dont need noxs menu for the pack scripts,  All the actions are done through the fn_selfactions.sqf

Here is the pack bike. As for mozzie or anything you want to add, just change the classname of the vehicle you want to spawn. In this one its the Old_bike_TK_CIV_EP1

Spoiler

if (false) then {
// player is in combat and cant pack his bike
    cutText [format["You are in combat and cannot re-pack your bike."], "PLAIN DOWN"];
} else {
    if (typeOf cursorTarget == "Old_bike_TK_CIV_EP1" || typeOf cursorTarget == "MMT_Civ") then {
    // player is looking at a bike and the target has a bike classname
    // delete it first to avoid player changing to another target
        deletevehicle cursorTarget;
        player removeAction s_player_deploybike2;
        player playActionNow "Medic";
        r_interrupt = false;
        player addWeapon "ItemToolbox";       
        _dis=10;
        _sfx = "repair";
        [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
        [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
        sleep 6;
        cutText [format["You have packed your bike and been given back your toolbox"], "PLAIN DOWN"];
        r_interrupt = false;
        player switchMove "";
        player playActionNow "stop";
    } else {
        // player is not looking at a bike, or target does not have a bike classname
        cutText [format["You have to be facing your bike to re-pack it!"], "PLAIN DOWN"];
    };
};

Now you call this file with a block of code, added in your fn_selfactions.sqf.

Add this on the bottom

//pack bike
	_isBike = typeOf cursorTarget in ["Old_bike_TK_INS_EP1","Old_bike_TK_CIV_EP1"];
	
if((_isBike) && _canDo) then {
                if (s_player_deploybike2 < 0) then {
                s_player_deploybike2 = player addaction[("<t color=""#007ab7"">" + ("Re-Pack Bike") +"</t>"),"custom\pack\packbike.sqf","",5,false,true,"", ""];
    };
        } else {
    player removeAction s_player_deploybike2;
    s_player_deploybike2 = -1;
        };
				

Make sure your path is correct to where ever you put the packbike.sqf

as for the deploy script. its the same thing for the pack if you want to crate multiple deployables. Just duplicate the file, change the name to deploymozzie.sqf  and change the classname to the mozzie.

Here is my deploy little bird (only showing you this one for use of multiple items)

 

Spoiler

private ["_finished","_finishedTime","_posplr","_dirplr","_object"];

if (dayz_combat == 1) exitWith {
    cutText [format["You are in Combat and cannot build a Little Bird."], "PLAIN DOWN"];
};
if ("ItemToolbox" in weapons Player) then {
    if ("PartGeneric" in Magazines Player) then {
        if("PartEngine" in Magazines Player)then {
        if("PartVRotor" in Magazines Player)then {

call spawnlittlebird;
} else {
cutText [format["You do not have the required parts"], "PLAIN DOWN"];
};

spawnlittlebird = {
    player removeWeapon "ItemToolbox";
    player removeMagazine "PartEngine";
    player removeMagazine "PartGeneric";
    player removeMagazine "PartVRotor";
    

    player playActionNow "Medic";
    [player,"repair",0,false,10] call dayz_zombieSpeak;
    [player,10,true,(getPosATL player)] spawn player_alertZombies;
    
    r_doLoop = true;

    _finished = false;
    _finishedTime = diag_tickTime+3;
    while {r_doLoop} do {
        if (diag_tickTime >= _finishedTime) then {
            r_doLoop = false;
            _finished = true;
        };
    };
    if (_finished) then {
        
        _posplr = [((getPos player) select 0) + 2, ((getPos player) select 1) + 2, 0];
        
        _dirplr = getDir player;

        _object = "AH6X_DZ" createVehicle (_posplr);
        _object setVariable ["ObjectID", "1", true];
        _object setVariable ["ObjectUID", "1", true];
        _object setVariable ["Spawnedlittlebird",1,true];
        _object setVariable ["Sarge",1,true];

        player reveal _object;

        cutText [format["You've used your toolbox to build a Little Bird."], "PLAIN DOWN"];
        sleep 10;
        cutText [format["Warning: Spawned Helis DO NOT SAVE after server restart!"], "PLAIN DOWN"];        
    };
};
};
};
};

 

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