Remove Parts From Vehicles (Simplified)

I just installed this and it works fine, but now I'm not able to cook meat on a fireplace anymore, somehow the 'cook meat' message doesn't show up... Is anyone familiar with this and could tell me how to fix this?

Well done on the script, thank you for sharing it with us :)
 
This script made players not able to repair vehicles properly. They would use the engine,rotor but it would not have any effect on the vehicle. I wish someone would take the time and rewrite it from the start.
 
This script made players not able to repair vehicles properly. They would use the engine,rotor but it would not have any effect on the vehicle. I wish someone would take the time and rewrite it from the start.
This Script dont Touch the original repaircode of dayz. The only Thing i can imagine is that the Server isnt fast enough to update database. If you remove a Part wait some Time or drop It in a Car and pick It up again.
 
I just installed this and it works fine, but now I'm not able to cook meat on a fireplace anymore, somehow the 'cook meat' message doesn't show up... Is anyone familiar with this and could tell me how to fix this?

Well done on the script, thank you for sharing it with us :)

Never seen this. Doublecheck your changes in selfactions.sqf. Or Even better restart from original selfaction and Paste the Script again.
 
ok it does work.. but no-one can harvest wood keeps saying "you are not in a forest" when they are. Tried it myself and i get the same. Any idea for a fix i think someone else had this in page 2?
 
It doesnt work on dayz 1.7.7 or i installed it wrong.

I just set it up on my 1.7.7 install. seems to give me the option, and puts the part in my vehicle, but doesn't actually remove the part from the vehicle.

I did the same edits as before. I'll look deeper.
 
I just set it up on my 1.7.7 install. seems to give me the option, and puts the part in my vehicle, but doesn't actually remove the part from the vehicle.

I did the same edits as before. I'll look deeper.

Try replace all "dayzSetFix" in ss_remove.sqf with "fnc_veh_handleDam"
i haven't got mine to work yet, but this might fix your problem.

This does not work ^
 
Try replace all "dayzSetFix" in ss_remove.sqf with "fnc_veh_handleDam"
i haven't got mine to work yet, but this might fix your problem.

This does not work ^
Weird that you can't get it to work at all.


i just installed ita gain on a fresh install of 1.7.7, and it works ,but still doesnt' actually remove the part. :(
I know they updated the vehicle repair in 1.7.7 so the code probably just needs modified to reflect the new changes.
 
When I try and remove a part, I get kicked for Public Variable Script Restriction #0.....
Variable.log shows:

- #0 "dayzSetFix" = [<NULL-object>,"glass1",1]

What the f?
 
Okay, solved it:

replace dayzSetFix = [_vehicle,_selection,0.89];
with
_total = [_vehicle, _selection, 0.89, _array, "zombie", true] call fnc_veh_handleDam;
where 0.89 is the damage.

Will post a working script tomorrow. Need to sleep now ;)
 
EDIT: small bugfix

okay here is the 1.7.7 version.
ss_remove.sqf:

Code:
// Remove Parts from Vehicles - By SilverShot.
// added anti dupingcode, dayz 1.7.7 compatibility and some description by NeverUsedID - www.die-philosoffen.com
 
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;
        //check if part is not damaged and remove it
        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");
                //check if part is engine or fueltank, otherwise vehicle will explode if damage is set to 1.
                if( _hitpoint == "HitEngine" or _hitpoint == "HitFuel" ) then {
                    _total = [_vehicle,  _selection, 0.89,  _array, "zombie", true] call fnc_veh_handleDam;
                } else {
                    // set damage to 1
                    _total = [_vehicle,  _selection, 1,  _array, "zombie", true] call fnc_veh_handleDam;
                };
                //play animation
                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];
       
            //recheck damage to be sure that part is removed from vehicle
                _damage = [_vehicle,_hitpoint] call object_getHit;
                if( _damage > 0.20 ) then {
                        _result = [player,_part] call BIS_fnc_invAdd;
                        //check if there is enough space in inventar
                        if (_result) then {
                            cutText [format["You have successfully taken %1 from the %2",_namePart,_nameType], "PLAIN DOWN"];
                        } else {
                            //if not enought space say "not enough space"
                            cutText [localize "str_player_24", "PLAIN DOWN"];
                            //and add the part back to the vehicle.
                            [_vehicle, _selection, 0, true] call fnc_veh_handleRepair;
                        };                   
                };
            } 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;
};
//update vehicle in database
[_vehicle,_type] spawn server_updateObject;
 
Back
Top