Submenu for repair / remove

Gagi2

Valued Member!
hi&hello...

i played on a server lately where the removing-parts-from-vehicles mod was installed too...
unfortunately i dont remember which server it was... :(

but they had the repair and the remove section put in a sub menu in the scroll menu...
so you had to choose repair to get all the damaged parts shown you could repair...
or you had to choose remove to get the intact parts shown you could remove...

does any one have clue about to get the menu modded like this?
the menu content could be a long list sometimes... with all these remove this and repair that entries in it ^^

regards
 
I agree, I've been trying to figure out how to do a submenu for the "Drop" command on my heli lift script too. Eg. You select "Drop Offroad" and the menu changes to "Are you sure?" Yes / No
 
hi&hello...

i played on a server lately where the removing-parts-from-vehicles mod was installed too...
unfortunately i dont remember which server it was... :(

but they had the repair and the remove section put in a sub menu in the scroll menu...
so you had to choose repair to get all the damaged parts shown you could repair...
or you had to choose remove to get the intact parts shown you could remove...

does any one have clue about to get the menu modded like this?
the menu content could be a long list sometimes... with all these remove this and repair that entries in it ^^

regards


editing the FN_SelfActions would be able to. lets say for removing.

Code:
if( _damage < 0.15 ) then {
 
if (!_skip ) then {
_string = format["<t color='#0096ff'>Remove%1</t>",_cmpt,_color]; //Remove - Part
_handle = silver_myCursorTarget addAction [_string, "Removeparts\ss_remove.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
s_player_removeActions set [count s_player_removeActions,_handle];
};};

thinking of a way to make it into a menu any ideas?
 
Code:
    if ((dayz_myCursorTarget != cursorTarget) and _isVehicle and !_isMan and _hasToolbox and (damage cursorTarget < 1))  then {
 
        if (s_player_repair_crtl < 0) then {
 
            _vehicle = cursorTarget;
            dayz_myCursorTarget = _vehicle;
 
            _menu = dayz_myCursorTarget addAction ["Repair Vehicle", "Blabla\script_that_calls_the_initial_repair_functions_and_later_calls_the repair_action",_vehicle, 0, true, false, "",""];
            _menu1 = dayz_myCursorTarget addAction ["Salvage Vehicle", "Blabla\script_that_calls_the_initial_salvage/strip_functions_and_later_calls_the salvage/strip_action",_vehicle, 0, true, false, "",""];
 
            s_player_repairActions set [count s_player_repairActions,_menu];
            s_player_repairActions set [count s_player_repairActions,_menu1];
 
            s_player_repair_crtl = 1;
 
        } else {
            {dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
            s_player_repair_crtl = -1;
        };
    };

Bottom:

Code:
s_player_repair_crtl = -1;

Made by DayZ Epoch Team.
 
-_- Still a copy paste kinda guy here :( I'm not sure how I can put that into my code. I probably have to split up what you did above for individual sections in this code.... Little help? Sorry for asking you to do my work for me -_-

Code:
    // Remove Parts from Vehicles - By SilverShot.
if( !_isMan and _canDo and _hasToolbox and (silver_myCursorTarget != cursorTarget) and cursorTarget isKindOf "AllVehicles" and (getDammage cursorTarget < 0.99) ) then {
_vehicle = cursorTarget;
_invalidVehicle = (_vehicle isKindOf "Motorcycle") or (_vehicle isKindOf "Tractor"); //or (_vehicle isKindOf "ATV_US_EP1") or (_vehicle isKindOf "ATV_CZ_EP1");
if( !_invalidVehicle ) then {
{silver_myCursorTarget removeAction _x} forEach s_player_removeActions;
s_player_removeActions = [];
silver_myCursorTarget = _vehicle;
 
_hitpoints = _vehicle call vehicle_getHitpoints;
 
{
_damage = [_vehicle,_x] call object_getHit;
 
if( _damage < 0.15 ) then {
 
//change "HitPart" to " - Part" rather than complicated string replace
_cmpt = toArray (_x);
_cmpt set [0,20];
_cmpt set [1,toArray ("-") select 0];
_cmpt set [2,20];
_cmpt = toString _cmpt;
 
_skip = true;
if( _skip and _x == "HitFuel" ) then { _skip = false; _part = "PartFueltank"; _cmpt = _cmpt + "tank"};
if( _skip and _x == "HitEngine" ) then { _skip = false; _part = "PartEngine"; };
if( _skip and _x == "HitLFWheel" ) then { _skip = false; _part = "PartWheel"; };
if( _skip and _x == "HitRFWheel" ) then { _skip = false; _part = "PartWheel"; };
if( _skip and _x == "HitLBWheel" ) then { _skip = false; _part = "PartWheel"; };
if( _skip and _x == "HitRBWheel" ) then { _skip = false; _part = "PartWheel"; };
if( _skip and _x == "HitGlass1" ) then { _skip = false; _part = "PartGlass"; };
if( _skip and _x == "HitGlass2" ) then { _skip = false; _part = "PartGlass"; };
if( _skip and _x == "HitGlass3" ) then { _skip = false; _part = "PartGlass"; };
if( _skip and _x == "HitGlass4" ) then { _skip = false; _part = "PartGlass"; };
if( _skip and _x == "HitGlass5" ) then { _skip = false; _part = "PartGlass"; };
if( _skip and _x == "HitGlass6" ) then { _skip = false; _part = "PartGlass"; };
if( _skip and _x == "HitHRotor" ) then { _skip = false; _part = "PartVRotor"; };
 
if (!_skip ) then {
_string = format["<t color='#0096ff'>Remove%1</t>",_cmpt,_color]; //Remove - Part
_handle = silver_myCursorTarget addAction [_string, "ss_remove.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
s_player_removeActions set [count s_player_removeActions,_handle];
};
};
 
} forEach _hitpoints;
};
};
    //Repairing Vehicles
    if ((dayz_myCursorTarget != cursorTarget) and _isVehicle and !_isMan and _hasToolbox and (damage cursorTarget < 1)) then {
        _vehicle = cursorTarget;
        {dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
        dayz_myCursorTarget = _vehicle;
 
        _allFixed = true;
        _hitpoints = _vehicle call vehicle_getHitpoints;
       
        {
            _damage = [_vehicle,_x] call object_getHit;
            _part = "PartGeneric";
           
            //change "HitPart" to " - Part" rather than complicated string replace
            _cmpt = toArray (_x);
            _cmpt set [0,20];
            _cmpt set [1,toArray ("-") select 0];
            _cmpt set [2,20];
            _cmpt = toString _cmpt;
               
            if(["Engine",_x,false] call fnc_inString) then {
                _part = "PartEngine";
            };
                   
            if(["HRotor",_x,false] call fnc_inString) then {
                _part = "PartVRotor"; //yes you need PartVRotor to fix HRotor LOL
            };
 
            if(["Fuel",_x,false] call fnc_inString) then {
                _part = "PartFueltank";
            };
           
            if(["Wheel",_x,false] call fnc_inString) then {
                _part = "PartWheel";
 
            };
                   
            if(["Glass",_x,false] call fnc_inString) then {
                _part = "PartGlass";
            };
 
            // get every damaged part no matter how tiny damage is!
            if (_damage > 0) then {
               
                _allFixed = false;
                _color = "color='#ffff00'"; //yellow
                if (_damage >= 0.5) then {_color = "color='#ff8800'";}; //orange
                if (_damage >= 0.9) then {_color = "color='#ff0000'";}; //red
 
                _string = format["<t %2>Repair%1</t>",_cmpt,_color]; //Repair - Part
                _handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\repair.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
                s_player_repairActions set [count s_player_repairActions,_handle];
 
            };
                   
        } forEach _hitpoints;
        if (_allFixed) then {
            _vehicle setDamage 0;
        };
    };
 
Actually, no i can't you'r file is nearly 100% different from mine. That's ridiculous.

Edit: I am going to uninstall my current salvage script and add in that one instead, maybe then i can get it working.
 
yea this one seems like it might work a bit better than my current salvage script, the other one lets you take parts off the vehicle and place said item into your inventory but the vehicle does not register there being a part removed so you can basically duplicate parts to your hearts content
 
yea this one seems like it might work a bit better than my current salvage script, the other one lets you take parts off the vehicle and place said item into your inventory but the vehicle does not register there being a part removed so you can basically duplicate parts to your hearts content
This is not a bug in SilverShot's salvage script, but DayZ 1.7.6.1 itself. Although the Epoch script has a built in failure chance based on the damage percentage of the part which is very nice.
 
After adding Epochs repair sub menu, i realized that re-filling jerry cans no longer works for me, anyone else having this issue?
 
Sami, did u just copy paste that code into your fnPlayerActions.sqf and then use the scripts they corispond with? I tried this, but it did not work, although my AH has a PlayerActions filter. it may have broken it.
 
Sami, did u just copy paste that code into your fnPlayerActions.sqf and then use the scripts they corispond with? I tried this, but it did not work, although my AH has a PlayerActions filter. it may have broken it.

That is what i did actually, and i just found all the files i wanted/needed and it worked
 
Back
Top