Remove Parts From Vehicles (Simplified)

Ok, the instructions make no sense to me.

Copy the compiles.sqf from "dayz_code\init" into your mission.pbo.

I don't have an init folder, except in my pbo and there is no compiles.sqf file in the pbo file.

Copy the fn_selfAction.sqf in "dayz_code\compile" to your mission.pbo

I don't have a compile folder, except in my pbo and there is no fn_selfAction.sqf in the pbo file.

I am hosting with DayzPriv, so maybe it's a little different?
 
Ok, the instructions make no sense to me.



I don't have an init folder, except in my pbo and there is no compiles.sqf file in the pbo file.



I don't have a compile folder, except in my pbo and there is no fn_selfAction.sqf in the pbo file.

I am hosting with DayzPriv, so maybe it's a little different?


The files are in your X:\blah\balh\arma 2 \@Dayz in there the you have dayz_code.pbo
 
It seems this allows some serious item duping... I can get unlimited parts from pretty much any vehicle at times. Anything I can do about that?

EDIT:
I am now trying wether adding a check if the engine is off, and emptying the fuel during the removal would help.
 
How do you get unlimited parts? A part can only be removed if it's green, so once you've removed the engine or fuel tank, they become red on the stripped vehicle and can't be removed again from the stripped vehicle.
 
How do you get unlimited parts? A part can only be removed if it's green, so once you've removed the engine or fuel tank, they become red on the stripped vehicle and can't be removed again from the stripped vehicle.
Freshly spawned Mi17, and I could remove glasses from it without them going red, and earlier couple of my friends took unlimited wheels from an S1203, by driving away with it while removing. It could have glitched without driving away too though. It's just not marking the parts as damaged properly at all.
 
I'm getting the same error. Should I be taking the fn_selfactions and compiles sqfs from @Taviana/addons/dayz_code.pbo or from @dayz/addons/dayz_code.pbo ? I currently have set it up using the files from @dayz.


For those getting these errors, most of these new server additions have you call these edited files from a new folder in YOUR mission pbo. You would basically make a copy of the, for example, compiles.sqf FROM the dayz_codes folder, and place YOUR copy into a new folder (labeled for example, "fixes"). You can name your folder whatever you want.

Then you open YOUR init.sqf and change the line that calls for the compiles sqf.
Code:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";

To this:
Code:
call compile preprocessFileLineNumbers "fixes\compiles.sqf";

Then you would do the same with the fn_selfActions.sqf as well. You just need to into the compiles.sqf and adjust the pathing for that as well to call from your "fixes" folder. And then of course, put a copy of the selfActions into that folder.

As far as the duping items go, I seem to be having the same issue. It works for SOME vehicles, but others, we had to start the engine first, before we could remove or add parts to the vehicle.
 
For those getting these errors, most of these new server additions have you call these edited files from a new folder in YOUR mission pbo. You would basically make a copy of the, for example, compiles.sqf FROM the dayz_codes folder, and place YOUR copy into a new folder (labeled for example, "fixes"). You can name your folder whatever you want.

Then you open YOUR init.sqf and change the line that calls for the compiles sqf.
Code:
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";

To this:
Code:
call compile preprocessFileLineNumbers "fixes\compiles.sqf";

Then you would do the same with the fn_selfActions.sqf as well. You just need to into the compiles.sqf and adjust the pathing for that as well to call from your "fixes" folder. And then of course, put a copy of the selfActions into that folder.

Installing this on Taviana works differently. Taviana already overrides the dayz compile file. For Tavi, you need to copy the Tavi compile file from the @Taviana folder (see the path in the code block below), not from @Dayz. Then find in the init where Taviana overrides the compile, comment that out, and reference your copy.

Code:
// (Taviana) Don't call the regular compile:
// call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf"; //Compile regular functions
 
// (Taviana) Instead, call a copy of the DayZ 1.7.4.4 compiles:
//call compile preprocessFileLineNumbers "\kh\dayztaviana\init\compiles.sqf"; //Compile regular functions
 
//No, don't do that, call a copy of the taviana compiles file that's in the mission file.  -DV
call compile preprocessFileLineNumbers "compiles.sqf";
 
Hi all,

I seen to have this problem, after removing a tire and kept in items slots. After re-login the tire seen to be gone, assume it is not save to the database. Work around - after removing put the tire in veh follow by put it in items slots..
any advise??

Map: Chernarus
Server: dayz.st
 
Have the problem of itemduping too.

ONLY the driver can remove parts. When other people removing parts the part is dupicated.

Its a normal Dayz Chenarus Server
 
i think its because a destroyed engine will explode the vehicle. but please try it with more players on the same car. i can dupe items with more players as much as i want.
 
Have fixed the duping issue by changing the script. Need some more testing.
Code:
// Remove Parts from Vehicles - By SilverShot. Dupingpatch by NeverUsedID
 
private["_vehicle","_part","_hitpoint","_type","_selection","_array"];
_id = _this select 2;
_array =    _this select 3;
_vehicle =    _array select 0;
_part =        _array select 1;
_hitpoint = _array select 2;
_type = typeOf _vehicle;
 
_hasToolbox =    "ItemToolbox" in items player;
 
_nameType =        getText(configFile >> "cfgVehicles" >> _type >> "displayName");
_namePart =        getText(configFile >> "cfgMagazines" >> _part >> "displayName");
 
if (_hasToolbox) then {
    if (getDammage _vehicle < 2) then {
 
        _damage = [_vehicle,_hitpoint] call object_getHit;
 
        if( _damage < 0.20 ) then {
                {silver_myCursorTarget removeAction _x} forEach s_player_removeActions;
                s_player_removeActions = [];
                silver_myCursorTarget = objNull;
 
                _selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name");
                if( _hitpoint == "HitEngine" or _hitpoint == "HitFuel" ) then {
                    dayzSetFix = [_vehicle,_selection,0.89];
                } else {
                    dayzSetFix = [_vehicle,_selection,1];
                };
                publicVariable "dayzSetFix";
                if (local _vehicle) then {
                    dayzSetFix call object_setFixServer;
                };
 
                player playActionNow "Medic";
                sleep 1;
 
                [player,"repair",0,false] call dayz_zombieSpeak;
                null = [player,10,true,(getPosATL player)] spawn player_alertZombies;
                sleep 5;
                _vehicle setvelocity [0,0,1];
           
                _damage = [_vehicle,_hitpoint] call object_getHit;
                //Dupingpatch
                if( _damage > 0.20 ) then {
                        _result = [player,_part] call BIS_fnc_invAdd;
                       
                        if (_result) then {
                            cutText [format["You have successfully taken %1 from the %2",_namePart,_nameType], "PLAIN DOWN"];
                        } else {
                            cutText [localize "str_player_24", "PLAIN DOWN"];
                            dayzSetFix = [_vehicle,_selection,0];
                        };
                        publicVariable "dayzSetFix";
                        if (local _vehicle) then {
                            dayzSetFix call object_setFixServer;
                        };
                };
            } else {
            cutText [format["Cannot remove %1 from %2, the part has been damaged.",_namePart,_nameType], "PLAIN DOWN"];
        };
    } else {
        {silver_myCursorTarget removeAction _x} forEach s_player_removeActions;
        s_player_removeActions = [];
        silver_myCursorTarget = objNull;
    };
};
 
if( silver_myCursorTarget != objNull ) then {
    {silver_myCursorTarget removeAction _x} forEach s_player_removeActions;
    s_player_removeActions = [];
    silver_myCursorTarget = objNull;
};
 
Have fixed the duping issue by changing the script. Need some more testing.
Code:
// Remove Parts from Vehicles - By SilverShot. Dupingpatch by NeverUsedID
 
private["_vehicle","_part","_hitpoint","_type","_selection","_array"];
_id = _this select 2;
_array =    _this select 3;
_vehicle =    _array select 0;
_part =        _array select 1;
_hitpoint = _array select 2;
_type = typeOf _vehicle;
 
_hasToolbox =    "ItemToolbox" in items player;
 
_nameType =        getText(configFile >> "cfgVehicles" >> _type >> "displayName");
_namePart =        getText(configFile >> "cfgMagazines" >> _part >> "displayName");
 
if (_hasToolbox) then {
    if (getDammage _vehicle < 2) then {
 
        _damage = [_vehicle,_hitpoint] call object_getHit;
 
        if( _damage < 0.20 ) then {
                {silver_myCursorTarget removeAction _x} forEach s_player_removeActions;
                s_player_removeActions = [];
                silver_myCursorTarget = objNull;
 
                _selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name");
                if( _hitpoint == "HitEngine" or _hitpoint == "HitFuel" ) then {
                    dayzSetFix = [_vehicle,_selection,0.89];
                } else {
                    dayzSetFix = [_vehicle,_selection,1];
                };
                publicVariable "dayzSetFix";
                if (local _vehicle) then {
                    dayzSetFix call object_setFixServer;
                };
 
                player playActionNow "Medic";
                sleep 1;
 
                [player,"repair",0,false] call dayz_zombieSpeak;
                null = [player,10,true,(getPosATL player)] spawn player_alertZombies;
                sleep 5;
                _vehicle setvelocity [0,0,1];
           
                _damage = [_vehicle,_hitpoint] call object_getHit;
                //Dupingpatch
                if( _damage > 0.20 ) then {
                        _result = [player,_part] call BIS_fnc_invAdd;
                       
                        if (_result) then {
                            cutText [format["You have successfully taken %1 from the %2",_namePart,_nameType], "PLAIN DOWN"];
                        } else {
                            cutText [localize "str_player_24", "PLAIN DOWN"];
                            dayzSetFix = [_vehicle,_selection,0];
                        };
                        publicVariable "dayzSetFix";
                        if (local _vehicle) then {
                            dayzSetFix call object_setFixServer;
                        };
                };
            } else {
            cutText [format["Cannot remove %1 from %2, the part has been damaged.",_namePart,_nameType], "PLAIN DOWN"];
        };
    } else {
        {silver_myCursorTarget removeAction _x} forEach s_player_removeActions;
        s_player_removeActions = [];
        silver_myCursorTarget = objNull;
    };
};
 
if( silver_myCursorTarget != objNull ) then {
    {silver_myCursorTarget removeAction _x} forEach s_player_removeActions;
    s_player_removeActions = [];
    silver_myCursorTarget = objNull;
};

I'll give this new version a go today & let you know how it seems over the next few days.
 
HI, have forgotten some information:

With my patch:
If you remove a part when you are NOT the driver you will get the animation, but you dont get the part. If so, jump in as driver, jump out and try again, then you should get the item.
 
the patch disabled the mod for me. came back online when i replaced your patch back to original. is there a way to prevent vehicles with engine health of 0% from starting? just disable movement and engine sound maybe?
 
the patch disabled the mod for me. came back online when i replaced your patch back to original. is there a way to prevent vehicles with engine health of 0% from starting? just disable movement and engine sound maybe?

do you tried to jump in as driver ? Sometimes you can only remove Parts if you was the last driver. Works very well on our Servers, beside the Driverbug. If you have the bug you get the removeanimation, but nothing happens. My patch prevent only the duping, but it doesnt solve the problem with the driver.

Dont know about the Enginething, sry...
 
i tried to jump in as driver yes, an multi cars/helis. it did not give me the option to pull parts out after i changed it to your patch. :/
 
Back
Top