Strip vehicles for parts

ConnorJ

Member
Does anyone have any idea how to create a script that would let you strip parts of other vehicles so you could use them?
 
Think it has to be dropped in the Mission-File. Create a new Folder in your MPMission, called "fixes". drop the sqf in there, open your init.sqf and search for the line
Code:
if (!isDedicated) then {
and drop this line under it
Code:
 [] execVM "fixes\ss_remove.sqf";

But as i write this, there is some code missing, because the script needs an array of data to work with... will not work this way.
 
i found this maybe this will help

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.95) ) 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, "scripts\ss_remove.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
                        s_player_removeActions set [count s_player_removeActions,_handle];
                    };
                };
 
            } forEach _hitpoints;
        };
    };
 
i got it working :D

open init.sqf in your mission.pbo
then replace the Load in compiled functions code
with this code here under

Code:
//Load in compiled functions
//call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";                //Initilize the Variables (IMPORTANT: Must happen very early)
call compile preprocessFileLineNumbers "dayz_code\init\variables.sqf";                //Initilize the Variables (IMPORTANT: Must happen very early)
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";                //Initilize the publicVariable event handlers
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";    //Functions used by CLIENT for medical
progressLoadingScreen 0.4;
//call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";
call compile preprocessFileLineNumbers "dayz_code\init\compiles.sqf";                //Compile regular functions
progressLoadingScreen 1.0;

Then download the file i uploaded it out it in your mission.pbo
and your done.

there are some stuff what i added for me own server you can keep it or remove it

1 edit compiles there are some stuff in it for me server what i like
2 dont remove compiles.sqf you need that
 

Attachments

  • strip vehicles.zip
    21.6 KB · Views: 1,135
i got it working :D

open init.sqf in your mission.pbo
then replace the Load in compiled functions code
with this code here under

Code:
//Load in compiled functions
//call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";                //Initilize the Variables (IMPORTANT: Must happen very early)
call compile preprocessFileLineNumbers "dayz_code\init\variables.sqf";                //Initilize the Variables (IMPORTANT: Must happen very early)
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";                //Initilize the publicVariable event handlers
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";    //Functions used by CLIENT for medical
progressLoadingScreen 0.4;
//call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";
call compile preprocessFileLineNumbers "dayz_code\init\compiles.sqf";                //Compile regular functions
progressLoadingScreen 1.0;

Then download the file i uploaded it out it in your mission.pbo
and your done.

there are some stuff what i added for me own server you can keep it or remove it

1 edit compiles there are some stuff in it for me server what i like
2 dont remove compiles.sqf you need that

Nice one man. Quick question though has this addition got any weird stuff like not being able to do it on certain vehicles or anything like that. Otherwise good work.
 
it will work only on all cars and all choppers
i tested it with rmod i dont know if it works without it

edite
if you wanne see how it works join me server 94.23.233.28:2362
 
glowpowner do you have instructions for what to add to a Taviana server?

Can you provide the invidual code you added instead of the zipped files that you are currently using?

I don't run Chernarus and would like to test this out on my Taviana server.

Thanks!
 
never runned Taviana server can you give me a link where i can get the server files
then i can look in to it but i think its the same way

only files you need in me zip are
fn_selfActions.sqf
ss_remove.sqf
compiles.sqf
variables.sqf (idk for sure you can test it without it)
 
i got it working :D

open init.sqf in your mission.pbo
then replace the Load in compiled functions code
with this code here under

Code:
//Load in compiled functions
//call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";                //Initilize the Variables (IMPORTANT: Must happen very early)
call compile preprocessFileLineNumbers "dayz_code\init\variables.sqf";                //Initilize the Variables (IMPORTANT: Must happen very early)
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";                //Initilize the publicVariable event handlers
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";    //Functions used by CLIENT for medical
progressLoadingScreen 0.4;
//call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";
call compile preprocessFileLineNumbers "dayz_code\init\compiles.sqf";                //Compile regular functions
progressLoadingScreen 1.0;

Then download the file i uploaded it out it in your mission.pbo
and your done.

there are some stuff what i added for me own server you can keep it or remove it

1 edit compiles there are some stuff in it for me server what i like
2 dont remove compiles.sqf you need that

Does this include a siphon fuel from vehicles? And with the new forms of meat, will this mess with cooking?.. Didn't see anything about the new meat in the fn_selfAction.sqf
 
Back
Top