Remove Parts From Vehicles (Simplified)

Yes, i can confirm this. The script will work, but you remove more parts on a vehicle at the moment. You cant dupe them. For the moment you have some spare wheels and glasses in your vehicles :)

Will take a closer look on it, but i realy dont have an idea why this happens. I think i can change ss_remove to ignore strange parts...
 
Okay, finally i found the bug in the original code.
forget all what i said about 1.8 fix before and use the normal ss_remove for 1.7.7.1,
but replace the fn_selfactioncode from original Post with this one:

Code:
    // Remove Parts from Vehicles - By SilverShot - 1.8 fix by NeverUsedID www.die-philosoffen.com
    if( !_isMan and _canDo and _hasToolbox and (silver_myCursorTarget != cursorTarget) and cursorTarget isKindOf "AllVehicles" and (getDammage cursorTarget < 0.95) ) then {
        _vehicle = cursorTarget;
        //Frank aka Wofu: Added check for busline, to prevent players from removing parts from the tourbusses.
        _invalidVehicle = (_vehicle isKindOf "Motorcycle") or (_vehicle isKindOf "Tractor"); //or ([_vehicle] call isDPBus);
        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='#ff00ff'>Remove%1</t>",_cmpt,_color]; //Remove - Part
        _handle = silver_myCursorTarget addAction [_string, "custom\ss_remove.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
        s_player_removeActions set [count s_player_removeActions,_handle];
        };
    };
 
    } forEach _hitpoints;
    };
};

for the one who already have the brokenversion on the server:

All you need is to add is is ,"_part" to private["_isStash..... at line 7 in fn_selfaction.
 
  • Like
Reactions: BDC
So for some reason when I got to take parts from a vehicle, the text is pink, it does the action and says that I have no room. Did I do something else in another script? I scanned the files that I have edited and I do not see anything related.
 
It still won't work for me. It's my favorite script running by far, so I've been tweaking things for a couple days trying to get it going in 1.8 Day Z. Any ideas where I might have gone wrong? I pasted the code that NeverUsedId posted above, and I'm using the 1.7.7.1 version of ss_remove.sqf. I don't get the removal option displayed at all, even on perfectly undamaged cars.
 
To get my original script to work:

All you need is to add is is ,"_part" to private["_isStash..... at line 7 in fn_selfaction.
 
I also did the fix from page 6 and am working just fine. Thanks everyone.
This won't actually remove the part from vehicle, but still adds it to your inventory and you can remove all parts like middle wheels from all vehicles. This is how it works for you too or did I mess up something?
 
This won't actually remove the part from vehicle, but still adds it to your inventory and you can remove all parts like middle wheels from all vehicles. This is how it works for you too or did I mess up something?

that was my prob too.

did you try:

All you need is to add is is ,"_part" to private["_isStash..... at line 7 in fn_selfacttion.sqf ?
 
This won't actually remove the part from vehicle, but still adds it to your inventory and you can remove all parts like middle wheels from all vehicles. This is how it works for you too or did I mess up something?
It pulls the part off for me. I do get some extra part options, but not on every vehicle.
 
Not working for me, the vehicles keep telling the players that they have no inventory.
I looked for line 7 and found it but my line 7 in self actions is
_vehicle = vehicle Player;
 
This is driving me crazy. I am dying for some information.
The menus show up for every vehicle but the result is that the player has no space in his inventory when that isn't the case. I cannot get this error to stop happening... I have re done this over and over.
 
This is driving me crazy. I am dying for some information.
The menus show up for every vehicle but the result is that the player has no space in his inventory when that isn't the case. I cannot get this error to stop happening... I have re done this over and over.


Find:
Code:
_isVehicle = _cursorTarget isKindOf "AllVehicles";
and put right after:
Code:
_part = _cursorTarget isKindOf "AllVehicles";

Only Problem so far: The Parts dont get removed from vehicles, so it is possible to duplicate the items o_O
 
NeverUsedID, can you please post your ss_remove.sqf and fn_selfactions.sqf?

you say (All you need is to add is is ,"_part" to private["_isStash..... at line 7) but the way it is written is very confusing.
 
Find:
Code:
_isVehicle = _cursorTarget isKindOf "AllVehicles";
and put right after:
Code:
_part = _cursorTarget isKindOf "AllVehicles";

Only Problem so far: The Parts dont get removed from vehicles, so it is possible to duplicate the items o_O

Hey SchwEde. Did you ever find a clean solution to this? Whenever I try (using the script), I get the "not enough inventory space" message as well.
 
Back
Top